How to use casino method in stryker-parent

Best JavaScript code snippet using stryker-parent

toplist-variation-34.js

Source:toplist-variation-34.js Github

copy

Full Screen

1$(document).ready(function($) {2 var modalToggler = $('#popupModalToggler');3 var compareSection = $('#compareWidget');4 toggleModal();5 handlePopupClose();6 handleRemoveAll();7 handleItemsToCompareLine();8 handleRemoveSingle();9 var casinos = [];10 var allCookies = $.cookie();11 for (const [key, value] of Object.entries(allCookies)) {12 var isCasinoCookie = key.includes('top-list-');13 if (isCasinoCookie) {14 addDataFromCookie(key, value);15 }16 }17 function addDataFromCookie(key, value) {18 var data = $.parseJSON(value);19 var firstEmptyBox = $('.compare-widget-selection .compare-widget-selection-item:not(.js-compare)').eq(0);20 var selectedLegth = $('.compare-widget-selection .compare-widget-selection-item.js-compare').length;21 var casinoObject = {};22 var casinoLogo = data.casinoLogo;23 var parentElId = data.parentElId;24 var casinoCountry = data.casinoCountry;25 var casinoCountryFlag = data.casinoCountryFlag;26 var casionName = data.casionName;27 var casinoLink = data.casinoLink;28 var casinoBonusValue = data.casinoBonusValue;29 var casinoPayoutValue = data.casinoPayoutValue;30 var casinoPayoutSpeed = data.casinoPayoutSpeed;31 var casinoMaxJackpot = data.casinoMaxJackpot;32 var casinoGamesNumber = data.casinoGamesNumber;33 var casinoGameInfo = data.casinoGameInfo;34 var casinoGamesMultiple = '';35 casinoGameInfo.forEach(function (arrayItem) {36 casinoGamesMultiple += '<div class="vertical-toplist-compare-icon-wrapper">'37 + '<img src="' + arrayItem.gameIcon + '" alt="Game" />'38 + '<div class="vertical-toplist-compare-games-label">' + arrayItem.gameName + '</div>'39 + '</div>';40 });41 var isFreeGames = data.isFreeGames;42 var casinoGameDevices = data.casinoGameDevices;43 var casinoDevicesMultiple = '';44 casinoGameDevices.forEach(function (arrayItem) {45 casinoDevicesMultiple += '<div class="vertical-toplist-compare-compabitility-icon-wrapper">'46 + '<img src="' + arrayItem.deviceIcon + '" alt="Game device" />'47 + '<div class="vertical-toplist-compare-games-label-devices">' + arrayItem.deviceName + '</div>'48 + '</div>';49 });50 var casinoGameBank = data.casinoGameBank;51 var casinoBanksMultiple = '';52 casinoGameBank.forEach(function (arrayItem) {53 casinoBanksMultiple += '<img src="' + arrayItem.bankIcon + '" alt="Game bank" />'54 });55 var casinoGameCountry = data.casinoGameCountry;56 var casinoCountriesMultiple = '';57 casinoGameCountry.forEach(function (arrayItem) {58 casinoCountriesMultiple += '<div class="vertical-toplist-compare-language-icon-wrapper">'59 + '<img src="' + arrayItem.countryIcon + '" alt="' + arrayItem.countryName + '" />'60 + '</div>';61 });62 var isLiveChat = data.isLiveChat;63 var casinoSupportEmail = data.casinoSupportEmail;64 var casinoSupportPhone = data.casinoSupportPhone;65 var casinoLicenseName = data.casinoLicenseName;66 var casinoOperatorName = data.casinoOperatorName;67 /* Filling cookie object start */68 casinoObject["parentElId"] = parentElId;69 casinoObject["casinoLogo"] = casinoLogo;70 casinoObject["casinoCountry"] = casinoCountry;71 casinoObject["casinoCountryFlag"] = casinoCountryFlag;72 casinoObject["casionName"] = casionName;73 casinoObject["casinoLink"] = casinoLink;74 casinoObject["casinoBonusValue"] = casinoBonusValue;75 casinoObject["casinoPayoutValue"] = casinoPayoutValue;76 casinoObject["casinoPayoutSpeed"] = casinoPayoutSpeed;77 casinoObject["casinoMaxJackpot"] = casinoMaxJackpot;78 casinoObject["casinoGamesNumber"] = casinoGamesNumber;79 casinoObject["casinoGameInfo"] = casinoGameInfo;80 casinoObject["isFreeGames"] = isFreeGames;81 casinoObject["casinoGameDevices"] = casinoGameDevices;82 casinoObject["casinoGameBank"] = casinoGameBank;83 casinoObject["casinoGameCountry"] = casinoCountriesMultiple;84 casinoObject["isLiveChat"] = isLiveChat;85 casinoObject["casinoSupportEmail"] = casinoSupportEmail;86 casinoObject["casinoSupportPhone"] = casinoSupportPhone;87 casinoObject["casinoLicenseName"] = casinoLicenseName;88 casinoObject["casinoOperatorName"] = casinoOperatorName;89 /* Filling cookie object end */90 firstEmptyBox.attr('data-id', parentElId);91 firstEmptyBox.addClass('js-compare');92 var boxResult = firstEmptyBox.find('.casino-compared-result');93 $('#' + parentElId).find('.info .btn-primary').addClass('js-checked');94 $('#' + parentElId).find('.info .btn-primary').text('Remove');95 if (boxResult.length) {96 boxResult.append('<button class="casino-compared-delete" href="#" data-id="'+ parentElId +'"></button><img class="casino-compared-image js-compare-logo" src="' + casinoLogo + '" alt="Image">');97 /* Adding casion column to popup start */98 $('#toplist .vertical-toplist-compare.vertical-toplist-compare-columns').append('<div class="vertical-toplist-compare-col vertical-toplist-compare-col-' + (selectedLegth + 1) + '" id="' + parentElId + '">'99 + '<div class="vertical-toplist-compare-top-wrapper">'100 + '<div class="vertical-toplist-compare-logo-wrapper">'101 + '<div class="vertical-toplist-compare-logo">'102 + '<img src="' + casinoLogo + '" alt="Casino image">'103 + '</div>'104 + '<div class="vertical-toplist-compare-flag">'105 + '<img src="./img/' + casinoCountryFlag + '.svg" alt="Flag" class="flag-icon" />'106 + '<img src="./img/tick-white.svg" alt="Checkmark" class="check-icon" />'107 + '</div>'108 + '</div>'109 + '<div class="vertical-toplist-compare-top-wrapper-rating">'110 + '<span class="vertical-toplist-compare-top-wrapper-label">Rating:</span>'111 + '<div class="popup-ranking-stars-container">'112 + '<img src="./img/rating.png" alt="Rating" class="rating-stars" />'113 + '</div>'114 + '</div>'115 + '<a href="' + casinoLink + '" class="vertical-toplist-compare-link-review">' + casionName + '</a>'116 + '</div>'117 + '<div class="vertical-toplist-compare-bonus vertical-toplist-compare-item">'118 + '<div class="vertical-toplist-compare-mobile-heading">Bonus</div>'119 + '<p class="vertical-toplist-compare-bonus-label">'120 + '<span class="vertical-toplist-compare-bonus-value">' + casinoBonusValue + '</span>'121 + '</p>'122 + '<span class="vertical-toplist-compare-bonus-text">Bonus</span>'123 + '</div>'124 + '<div class="vertical-toplist-compare-payout vertical-toplist-compare-item">'125 + '<div class="vertical-toplist-compare-mobile-heading">Payout %</div>'126 + '<p class="vertical-toplist-compare-payout-label">' 127 + '<span class="vertical-toplist-compare-payout-value">' + casinoPayoutValue + '</span>'128 + '</p>'129 + '</div>'130 + '<div class="vertical-toplist-compare-payout-speed vertical-toplist-compare-item">'131 + '<div class="vertical-toplist-compare-mobile-heading">Payout Speed</div>'132 + '<p class="vertical-toplist-compare-payout-speed-label">'133 + '<span class="vertical-toplist-compare-payout-speed__value">' + casinoPayoutSpeed + '</span>'134 + '</p>'135 + '</div>'136 + '<div class="vertical-toplist-compare-payout-speed vertical-toplist-compare-item">'137 + '<div class="vertical-toplist-compare-mobile-heading">Max Jackpot</div>'138 + '<p class="vertical-toplist-compare-payout-speed-label">'139 + '<span class="vertical-toplist-compare-payout-speed__value">' + casinoMaxJackpot + '<span> Million</span></span>'140 + '</p>'141 + '</div>'142 + '<div class="vertical-toplist-compare-games vertical-toplist-compare-item">'143 + '<div class="vertical-toplist-compare-mobile-heading">No. of Games</div>'144 + '<div class="vertical-toplist-compare-games-number">' + casinoGamesNumber + '</div>'145 + '<div class="vertical-toplist-compare-games-label">including...</div>'146 + '<div class="vertical-toplist-compare-games-wrapper">'147 + casinoGamesMultiple148 + '</div>'149 + '</div>'150 + '<div class="vertical-toplist-compare-free-games vertical-toplist-compare-item">'151 + '<div class="vertical-toplist-compare-mobile-heading">Free Games</div>'152 + (isFreeGames ? '<img src="./img/tick.svg" alt="Check" />' : '<img src="./img/tick.svg" alt="Check" style="visibility: hidden" />')153 + '</div>'154 + '<div class="vertical-toplist-compare-compabitility vertical-toplist-compare-item">'155 + '<div class="vertical-toplist-compare-mobile-heading">Free Games</div>'156 + casinoDevicesMultiple157 + '</div>'158 + '<div class="vertical-toplist-compare-deposit vertical-toplist-compare-item 1">'159 + '<div class="vertical-toplist-compare-mobile-heading">Banking Options</div>'160 + '<div class="vertical-toplist-compare-deposit-icon-wrapper">'161 + casinoBanksMultiple162 + '</div>'163 + '</div>'164 + '<div class="vertical-toplist-compare-language vertical-toplist-compare-item 1">'165 + '<div class="vertical-toplist-compare-mobile-heading">Languages</div>'166 + casinoCountriesMultiple167 + '</div>'168 + '<div class="vertical-toplist-compare-support vertical-toplist-compare-item">'169 + '<div class="vertical-toplist-compare-mobile-heading">Support</div>'170 + '<span> Live Chat: <strong>' + (isLiveChat ? "Yes" : "No") + '</strong>' + (isLiveChat ? '<img src="./img/tick.svg" alt="Tick" />' : '') + '</span>'171 + '<div class="vertical-toplist-compare-support-info">' + casinoSupportEmail + '</div>'172 + '<div class="vertical-toplist-compare-support-info">' + casinoSupportPhone + '</div>'173 + '</div>'174 + '<div class="vertical-toplist-compare-operator vertical-toplist-compare-item">'175 + '<div class="vertical-toplist-compare-mobile-heading">Operator Info</div>'176 + '<div class="vertical-toplist-compare-operator-wrapper">'177 + '<div class="vertical-toplist-compare-operator-label">OWNER / OPERATOR:</div>'178 + casinoLicenseName179 + '</div>'180 + '<div class="vertical-toplist-compare-operator-wrapper">'181 + '<div class="vertical-toplist-compare-operator-label">Licenced By:</div>'182 + casinoOperatorName183 + '</div>'184 + '</div>'185 + '</div>');186 /* Adding casion column to popup end */187 }188 var cookieStr = JSON.stringify(casinoObject);189 if (!$.cookie(casinoObject.parentElId)) {190 $.cookie(casinoObject.parentElId, cookieStr); //storing it in a cookie191 }192 casinos.push(casinoObject);193 var selectedItemsAmount = $('.compare-widget-selection .compare-widget-selection-item.js-compare').length;194 if (selectedItemsAmount) {195 compareSection.addClass('js-visible');196 } else {197 compareSection.removeClass('js-visible');198 }199 if (selectedItemsAmount >= 2) {200 modalToggler.addClass('js-enabled');201 } else {202 modalToggler.removeClass('js-enabled');203 }204 }205 function handleRemoveSingle() {206 $('.casino-compared-delete').click(function() {207 var dataId = $(this).attr('data-id');208 var delEl = $('.compare-widget-selection .compare-widget-selection-item[data-id="' + dataId + '"]');209 var delElPopup = $('.vertical-toplist-compare .vertical-toplist-compare-columns .vertical-toplist-compare-col[id="' + dataId + '"]');210 var boxResult = delEl.find('.casino-compared-result');211 if (delElPopup.attr('id') === dataId) {212 delElPopup.remove();213 }214 delEl.removeClass('js-compare');215 delEl.removeAttr('data-id');216 if (boxResult.length) {217 boxResult.empty();218 }219 var selectedItemsAmount = $('.compare-widget-selection .compare-widget-selection-item.js-compare').length;220 if (selectedItemsAmount) {221 compareSection.addClass('js-visible');222 } else {223 compareSection.removeClass('js-visible');224 }225 if (selectedItemsAmount >= 2) {226 modalToggler.addClass('js-enabled');227 } else {228 modalToggler.removeClass('js-enabled');229 }230 $('#' + dataId).find('.info .btn-primary').removeClass('js-checked');231 $('#' + dataId).find('.info .btn-primary').text('Compare');232 $.removeCookie(dataId);233 });234 }235 function toggleModal() {236 modalToggler.click(function() {237 if ($(this).hasClass('js-enabled')) {238 $('#modalPopup').addClass('opened');239 $('body').addClass('modal-opened');240 }241 });242 }243 function handlePopupClose() {244 $('#popupModalClose').click(function() {245 $('#modalPopup').removeClass('opened');246 $('body').removeClass('modal-opened');247 });248 }249 function handleRemoveAll() {250 $('.compare-widget-selection-reset').click(function() {251 var allEls = $('.compare-widget-selection .compare-widget-selection-item');252 $('.info .btn-primary').removeClass('js-checked');253 $('.info .btn-primary').text('Compare');254 allEls.removeClass('js-compare');255 allEls.removeAttr('data-id');256 allEls.find('.casino-compared-result').empty();257 $('#toplist .vertical-toplist-compare.vertical-toplist-compare-columns [id*="top-list-0"]').remove();258 modalToggler.removeClass('js-enabled');259 compareSection.removeClass('js-visible');260 casinos.forEach(function(item) {261 $.removeCookie(item.parentElId);262 });263 for (const [key, value] of Object.entries(allCookies)) {264 $.removeCookie(key);265 }266 });267 handleRemoveSingle();268 }269 function handleItemsToCompareLine() {270 $('.info .btn-primary').click(function() {271 var selectedLegth = $('.compare-widget-selection .compare-widget-selection-item.js-compare').length;272 var isSiblingChecked = $(this).hasClass('js-checked');273 var casinoObject = {};274 if ((selectedLegth < 3) || (selectedLegth >= 3) && isSiblingChecked) {275 $(this).toggleClass('js-checked');276 if($(this).text() === 'Compare') {277 $(this).text('Remove');278 } else {279 $(this).text('Compare');280 }281 var isChecked = $(this).hasClass('js-checked');282 var firstEmptyBox = $('.compare-widget-selection .compare-widget-selection-item:not(.js-compare)').eq(0);283 var parentEl = $(this).closest('.list-item');284 var casinoLogo = parentEl.find('.logo-image');285 var parentElId = parentEl.attr('id');286 /* Adding casion column to popup start */287 var casinoCountry = parentEl.find('.casinoCountry i');288 var casinoCountryFlag = casinoCountry.attr('class').replace('icon-flag-', '');289 var casionName = parentEl.find('.rating-name').text();290 var casinoLink = parentEl.attr('href');291 var casinoBonusValue = parentEl.find('.bonusValue').attr('bonusValue');292 var casinoPayoutValue = parentEl.find('.payoutValue').attr('payoutValue');293 var casinoPayoutSpeed = parentEl.find('.payoutSpeed').attr('payoutSpeed');294 var casinoMaxJackpot = parentEl.attr('maxJackpot');295 var casinoGamesNumber = parentEl.find('.casinoInfo').attr('gamesNumber');296 var casinoGameInfo = parentEl.find('.singleGame');297 var casinoGamesMultiple = '';298 var casinoGameInfoArr = [];299 casinoGameInfo.each(function() {300 casinoGamesMultiple += '<div class="vertical-toplist-compare-icon-wrapper">'301 + '<img src="' + $(this).attr('gameIcon') + '" alt="Game" />'302 + '<div class="vertical-toplist-compare-games-label">' + $(this).attr('gameName') + '</div>'303 + '</div>';304 var gameIcon = $(this).attr('gameIcon');305 var gameName = $(this).attr('gameName');306 casinoGameInfoArr.push({307 parentElId: parentElId,308 gameIcon: gameIcon,309 gameName: gameName,310 });311 });312 var isFreeGames = parentEl.find('.casinoInfo').attr('freeGames') === 'true';313 var casinoGameDevices = parentEl.find('.gameDevices');314 var casinoDevicesMultiple = '';315 var casinoGameDevicesArr = [];316 casinoGameDevices.each(function() {317 casinoDevicesMultiple += '<div class="vertical-toplist-compare-compabitility-icon-wrapper">'318 + '<img src="' + $(this).attr('deviceIcon') + '" alt="Game device" />'319 + '<div class="vertical-toplist-compare-games-label-devices">' + $(this).attr('deviceName') + '</div>'320 + '</div>';321 var deviceIcon = $(this).attr('deviceIcon');322 var deviceName = $(this).attr('deviceName');323 casinoGameDevicesArr.push({324 parentElId: parentElId,325 deviceIcon: deviceIcon,326 deviceName: deviceName,327 });328 });329 var casinoGameBank = parentEl.find('.gameBank');330 var casinoBanksMultiple = '';331 var casinoGameBankArr = [];332 casinoGameBank.each(function() {333 casinoBanksMultiple += '<img src="' + $(this).attr('bankIcon') + '" alt="Game bank" />';334 var bankIcon = $(this).attr('bankIcon');335 casinoGameBankArr.push({336 parentElId: parentElId,337 bankIcon: bankIcon,338 });339 });340 var casinoGameCountry = parentEl.find('.gameCountry');341 var casinoCountriesMultiple = '';342 var casinoGameCountryArr = [];343 casinoGameCountry.each(function() {344 casinoCountriesMultiple += '<div class="vertical-toplist-compare-language-icon-wrapper">'345 + '<img src="' + $(this).attr('countryIcon') + '" alt="' + $(this).attr('countryName') + '" />'346 + '</div>';347 var countryIcon = $(this).attr('countryIcon');348 var countryName = $(this).attr('countryName');349 casinoGameCountryArr.push({350 parentElId: parentElId,351 countryIcon: countryIcon,352 countryName: countryName,353 });354 });355 var isLiveChat = parentEl.find('.casinoInfo').attr('liveChat') === 'true';356 var casinoSupportEmail = parentEl.find('.casinoInfo').attr('supportEmail');357 var casinoSupportPhone = parentEl.find('.casinoInfo').attr('phoneNumber');358 var casinoLicenseName = parentEl.find('.casinoInfo').attr('licenseName');359 var casinoOperatorName = parentEl.find('.casinoInfo').attr('operatorName');360 /* Adding casion column to popup end */361 /* Filling cookie object start */362 casinoObject["parentElId"] = parentElId;363 casinoObject["casinoLogo"] = casinoLogo.attr('src');364 casinoObject["casinoCountry"] = casinoCountry;365 casinoObject["casinoCountryFlag"] = casinoCountryFlag;366 casinoObject["casionName"] = casionName;367 casinoObject["casinoLink"] = casinoLink;368 casinoObject["casinoBonusValue"] = casinoBonusValue;369 casinoObject["casinoPayoutValue"] = casinoPayoutValue;370 casinoObject["casinoPayoutSpeed"] = casinoPayoutSpeed;371 casinoObject["casinoMaxJackpot"] = casinoMaxJackpot;372 casinoObject["casinoGamesNumber"] = casinoGamesNumber;373 casinoObject["casinoGameInfo"] = casinoGameInfoArr;374 casinoObject["isFreeGames"] = isFreeGames;375 casinoObject["casinoGameDevices"] = casinoGameDevicesArr;376 casinoObject["casinoGameBank"] = casinoGameBankArr;377 casinoObject["casinoGameCountry"] = casinoGameCountryArr;378 casinoObject["isLiveChat"] = isLiveChat;379 casinoObject["casinoSupportEmail"] = casinoSupportEmail;380 casinoObject["casinoSupportPhone"] = casinoSupportPhone;381 casinoObject["casinoLicenseName"] = casinoLicenseName;382 casinoObject["casinoOperatorName"] = casinoOperatorName;383 /* Filling cookie object end */384 if (isChecked) {385 firstEmptyBox.attr('data-id', parentElId);386 firstEmptyBox.addClass('js-compare');387 var boxResult = firstEmptyBox.find('.casino-compared-result');388 if (boxResult.length) {389 boxResult.append('<button class="casino-compared-delete" href="#" data-id="'+ parentElId +'"></button><img class="casino-compared-image js-compare-logo" src="' + casinoLogo.attr('src') + '" alt="Image">');390 /* Adding casion column to popup start */391 $('#toplist .vertical-toplist-compare.vertical-toplist-compare-columns').append('<div class="vertical-toplist-compare-col vertical-toplist-compare-col-' + (selectedLegth + 1) + '" id="' + parentElId + '">'392 + '<div class="vertical-toplist-compare-top-wrapper">'393 + '<div class="vertical-toplist-compare-logo-wrapper">'394 + '<div class="vertical-toplist-compare-logo">'395 + '<img src="' + casinoLogo.attr('src') + '" alt="Casino image">'396 + '</div>'397 + '<div class="vertical-toplist-compare-flag">'398 + '<img src="./img/' + casinoCountryFlag + '.svg" alt="Flag" class="flag-icon" />'399 + '<img src="./img/tick-white.svg" alt="Checkmark" class="check-icon" />'400 + '</div>'401 + '</div>'402 + '<div class="vertical-toplist-compare-top-wrapper-rating">'403 + '<span class="vertical-toplist-compare-top-wrapper-label">Rating:</span>'404 + '<div class="popup-ranking-stars-container">'405 + '<img src="./img/rating.png" alt="Rating" class="rating-stars" />'406 + '</div>'407 + '</div>'408 + '<a href="' + casinoLink + '" class="vertical-toplist-compare-link-review">' + casionName + '</a>'409 + '</div>'410 + '<div class="vertical-toplist-compare-bonus vertical-toplist-compare-item">'411 + '<div class="vertical-toplist-compare-mobile-heading">Bonus</div>'412 + '<p class="vertical-toplist-compare-bonus-label">'413 + '<span class="vertical-toplist-compare-bonus-value">' + casinoBonusValue + '</span>'414 + '</p>'415 + '<span class="vertical-toplist-compare-bonus-text">Bonus</span>'416 + '</div>'417 + '<div class="vertical-toplist-compare-payout vertical-toplist-compare-item">'418 + '<div class="vertical-toplist-compare-mobile-heading">Payout %</div>'419 + '<p class="vertical-toplist-compare-payout-label">' 420 + '<span class="vertical-toplist-compare-payout-value">' + casinoPayoutValue + '</span>'421 + '</p>'422 + '</div>'423 + '<div class="vertical-toplist-compare-payout-speed vertical-toplist-compare-item">'424 + '<div class="vertical-toplist-compare-mobile-heading">Payout Speed</div>'425 + '<p class="vertical-toplist-compare-payout-speed-label">'426 + '<span class="vertical-toplist-compare-payout-speed__value">' + casinoPayoutSpeed + '</span>'427 + '</p>'428 + '</div>'429 + '<div class="vertical-toplist-compare-payout-speed vertical-toplist-compare-item">'430 + '<div class="vertical-toplist-compare-mobile-heading">Max Jackpot</div>'431 + '<p class="vertical-toplist-compare-payout-speed-label">'432 + '<span class="vertical-toplist-compare-payout-speed__value">' + casinoMaxJackpot + '<span> Million</span></span>'433 + '</p>'434 + '</div>'435 + '<div class="vertical-toplist-compare-games vertical-toplist-compare-item">'436 + '<div class="vertical-toplist-compare-mobile-heading">No. of Games</div>'437 + '<div class="vertical-toplist-compare-games-number">' + casinoGamesNumber + '</div>'438 + '<div class="vertical-toplist-compare-games-label">including...</div>'439 + '<div class="vertical-toplist-compare-games-wrapper">'440 + casinoGamesMultiple441 + '</div>'442 + '</div>'443 + '<div class="vertical-toplist-compare-free-games vertical-toplist-compare-item">'444 + '<div class="vertical-toplist-compare-mobile-heading">Free Games</div>'445 + (isFreeGames ? '<img src="./img/tick.svg" alt="Check" />' : '<img src="./img/tick.svg" alt="Check" style="visibility: hidden" />')446 + '</div>'447 + '<div class="vertical-toplist-compare-compabitility vertical-toplist-compare-item">'448 + '<div class="vertical-toplist-compare-mobile-heading">Free Games</div>'449 + casinoDevicesMultiple450 + '</div>'451 + '<div class="vertical-toplist-compare-deposit vertical-toplist-compare-item 1">'452 + '<div class="vertical-toplist-compare-mobile-heading">Banking Options</div>'453 + '<div class="vertical-toplist-compare-deposit-icon-wrapper">'454 + casinoBanksMultiple455 + '</div>'456 + '</div>'457 + '<div class="vertical-toplist-compare-language vertical-toplist-compare-item 1">'458 + '<div class="vertical-toplist-compare-mobile-heading">Languages</div>'459 + casinoCountriesMultiple460 + '</div>'461 + '<div class="vertical-toplist-compare-support vertical-toplist-compare-item">'462 + '<div class="vertical-toplist-compare-mobile-heading">Support</div>'463 + '<span> Live Chat: <strong>' + (isLiveChat ? "Yes" : "No") + '</strong>' + (isLiveChat ? '<img src="./img/tick.svg" alt="Tick" />' : '') + '</span>'464 + '<div class="vertical-toplist-compare-support-info">' + casinoSupportEmail + '</div>'465 + '<div class="vertical-toplist-compare-support-info">' + casinoSupportPhone + '</div>'466 + '</div>'467 + '<div class="vertical-toplist-compare-operator vertical-toplist-compare-item">'468 + '<div class="vertical-toplist-compare-mobile-heading">Operator Info</div>'469 + '<div class="vertical-toplist-compare-operator-wrapper">'470 + '<div class="vertical-toplist-compare-operator-label">OWNER / OPERATOR:</div>'471 + casinoLicenseName472 + '</div>'473 + '<div class="vertical-toplist-compare-operator-wrapper">'474 + '<div class="vertical-toplist-compare-operator-label">Licenced By:</div>'475 + casinoOperatorName476 + '</div>'477 + '</div>'478 + '</div>');479 /* Adding casion column to popup end */480 }481 var cookieStr = JSON.stringify(casinoObject);482 if (!$.cookie(casinoObject.parentElId)) {483 $.cookie(casinoObject.parentElId, cookieStr); //storing it in a cookie484 }485 casinos.push(casinoObject);486 } else {487 var delEl = $('.compare-widget-selection .compare-widget-selection-item[data-id="' + parentElId + '"]');488 var delElPopup = $('.vertical-toplist-compare .vertical-toplist-compare-columns .vertical-toplist-compare-col[id="' + parentElId + '"]');489 var boxResult = delEl.find('.casino-compared-result');490 delEl.removeClass('js-compare');491 delEl.removeAttr('data-id');492 if (delElPopup.attr('id') === parentElId) {493 delElPopup.remove();494 }495 if (boxResult.length) {496 boxResult.empty();497 }498 $.removeCookie(casinoObject.parentElId);499 casinos = casinos.filter(function( obj ) {500 return obj.parentElId !== parentElId;501 });502 }503 var selectedItemsAmount = $('.compare-widget-selection .compare-widget-selection-item.js-compare').length;504 if (selectedItemsAmount) {505 compareSection.addClass('js-visible');506 } else {507 compareSection.removeClass('js-visible');508 }509 if (selectedItemsAmount >= 2) {510 modalToggler.addClass('js-enabled');511 } else {512 modalToggler.removeClass('js-enabled');513 }514 handleRemoveSingle();515 }516 });517 }...

Full Screen

Full Screen

store.jsx

Source:store.jsx Github

copy

Full Screen

1import { createAsyncThunk, createSlice } from "@reduxjs/toolkit";2import allConfig from "../../config/allConfig";3//thunkApiHome4export const thunkApiHome = createAsyncThunk("betBuq/thunkApiHome", async () => {5 let prapashtes = {6 home: "get_sliders",7 /* liveCasino: `/get_slots/${allConfig.skinName}/casino_live/ios?lang=en`,8 */9 };10 return fetch(`${allConfig.contentManagementAPI}/${prapashtes.home}/`)11 .then((res) => res.json())12 .catch((err) => console.log(" error bro"));13});14//CasinoApi15export const CasinoApi = createAsyncThunk("betBuq/CasinoApi", async () => {16 return fetch("https://stagingbackoffice.playlogiq.com/Betbuq/get_slots/casino/ios?lang=en")17 .then((res) => res.json())18 .catch((err) => console.log(" error bro"));19});20//LiveCasinoApi21export const LiveCasinoApi = createAsyncThunk("betBuq/LiveCasinoApi", async () => {22 let casinoLive = {23 casino: `get_slots/${allConfig.skinName}/casino_live/ios?lang=en`,24 };25 return fetch(`${allConfig.contentManagementAPI}/${casinoLive.casino}`)26 .then((res) => res.json())27 .catch((err) => console.log(" error bro"));28});29//PrematchApi30export const PrematchApi = createAsyncThunk("betbuq/PrematchApi", async () => {31 let prematchP = {32 link: "main?json&l=en",33 };34 return fetch(`https://api-new.betbuq.com/prematch/${prematchP["link"]}`)35 .then((res) => res.json())36 .catch((err) => console.log("has error bro"));37});38let initialState = {39 bet: { allConfig },40 sliderApiHome: [],41 CasinoData: [],42 CategProvidCasinoModal: localStorage.getItem("CasinoModal") ? JSON.parse(localStorage.getItem("CasinoModal")) : [],43 CasinoModal: localStorage.getItem("cas") ? JSON.parse(localStorage.getItem("cas")) : [],44 CasinoFav: localStorage.getItem("casFav") ? JSON.parse(localStorage.getItem("casFav")) : [],45 LiveCasino: [],46 Favorites: localStorage.getItem("fav") ? JSON.parse(localStorage.getItem("fav")) : [],47 CategOrProvider: localStorage.getItem("catPro") ? JSON.parse(localStorage.getItem("catPro")) : [],48 userLog: false,49 PrematchData: [],50};51const act = createSlice({52 name: "betBuq",53 initialState,54 reducers: {55 //LIVE CASINO56 addFavorites: (state, action) => {57 const ekzistoIndex = state.Favorites.findIndex((item) => item.id === action.payload.id);58 if (ekzistoIndex >= 0) {59 /* state.Favorites[ekzistoIndex] = { ...state.Favorites[ekzistoIndex] };60 */61 let Fav = action.Favorites.filter((F) => F.id !== action.payload.id);62 action.Favorites = Fav;63 localStorage.setItem("fav", JSON.stringify(state.Favorites));64 } else {65 state.Favorites = [66 ...state.Favorites,67 {68 id: action.payload.id,69 desktop_logo: action.payload.desktop_logo,70 name: action.payload.name,71 },72 ];73 localStorage.setItem("fav", JSON.stringify(state.Favorites));74 }75 },76 delFavorites: (state, action) => {77 const newList = state.Favorites.filter((I) => I.id !== action.payload.id);78 state.Favorites = newList;79 localStorage.setItem("fav", JSON.stringify(state.Favorites));80 },81 addCategProvid: (state, action) => {82 const ekzistoCatProv = state.CategOrProvider.findIndex((I) => I.id === action.payload.id);83 if (ekzistoCatProv >= 0) {84 /* state.CategOrProvider[ekzistoCatProv] = {85 ...state.CategOrProvider[ekzistoCatProv],86 }; */87 let myCatProv = state.CategOrProvider.filter((R) => R.id !== action.payload.id);88 state.CategOrProvider = myCatProv;89 localStorage.setItem("catPro", JSON.stringify(state.CategOrProvider));90 } else {91 state.CategOrProvider = [92 ...state.CategOrProvider,93 {94 id: action.payload.id,95 name: action.payload.name,96 },97 ];98 localStorage.setItem("catPro", JSON.stringify(state.CategOrProvider));99 }100 },101 delCategProvid: (state, action) => {102 const newListCategOrProv = state.CategOrProvider.filter((I) => I.id !== action.payload.id);103 state.CategOrProvider = newListCategOrProv;104 localStorage.setItem("catPro", JSON.stringify(state.CategOrProvider));105 },106 delAllProvidrCateg: (state, action) => {107 state.CategOrProvider = [];108 localStorage.setItem("catPro", JSON.stringify(state.Favorites));109 },110 sortItemCateg: (state, { payload }) => {111 Object.values(state?.CasinoData?.result?.providers || {}).map((H, index) =>112 Object.values(H.slots || {}).sort((a, b) => (a.name.toLowerCase() > b.name.toLowerCase() ? 1 : -1))113 );114 },115 //CASINO116 addFavouriteCasino: (state, action) => {117 const ekzistoIndex = state.CasinoFav.findIndex((item) => item.id === action.payload.id);118 if (ekzistoIndex >= 0) {119 const nextCasinoFav = state.CasinoFav.filter((item) => item.id !== action.payload.id);120 state.CasinoFav = nextCasinoFav;121 } else {122 state.CasinoFav = [123 ...state.CasinoFav,124 {125 id: action.payload.id,126 desktop_logo: action.payload.desktop_logo,127 name: action.payload.name,128 },129 ];130 }131 localStorage.setItem("casFav", JSON.stringify(state.CasinoFav));132 },133 delFavouriteCasino: (state, action) => {134 const newCasinoFav = state.CasinoFav.filter((I) => I.id !== action.payload.id);135 state.CasinoFav = newCasinoFav;136 localStorage.setItem("casFav", JSON.stringify(state.CasinoFav));137 },138 addFavouriteCasinoModal: (state, action) => {139 const ekzistoIndexCasinoModal = state.CasinoModal.findIndex((item) => item.id === action.payload.id);140 if (ekzistoIndexCasinoModal >= 0) {141 const nextCasinoFav = state.CasinoModal.filter((item) => item.id !== action.payload.id);142 state.CasinoModal = nextCasinoFav;143 } else {144 state.CasinoModal = [145 ...state.CasinoModal,146 {147 id: action.payload.id,148 desktop_logo: action.payload.desktop_logo,149 name: action.payload.name,150 },151 ];152 }153 localStorage.setItem("cas", JSON.stringify(state.CasinoModal));154 },155 delFavoritesCasinoModal: (state, action) => {156 const newList = state.CasinoModal.filter((I) => I.id !== action.payload.id);157 state.CasinoModal = newList;158 localStorage.setItem("cas", JSON.stringify(state.CasinoModal));159 },160 addCategProvidCasinoModal: (state, action) => {161 const findItem = state.CategProvidCasinoModal.findIndex((T) => T.id === action.payload.id);162 if (findItem >= 0) {163 let filterAdded = state.CategProvidCasinoModal.filter((G) => G.id !== action.payload.id);164 state.CategProvidCasinoModal = filterAdded;165 localStorage.setItem("CasinoModal", JSON.stringify(state.CategProvidCasinoModal));166 } else {167 state.CategProvidCasinoModal = [168 ...state.CategProvidCasinoModal,169 {170 id: action.payload.id,171 name: action.payload.name,172 desktop_logo: action.payload.desktop_logo,173 },174 ];175 }176 localStorage.setItem("CasinoModal", JSON.stringify(state.CategProvidCasinoModal));177 },178 delCategProvidCasino: (state, action) => {179 const newListCategOrProv = state.CategProvidCasinoModal.filter((I) => I.id !== action.payload.id);180 state.CategProvidCasinoModal = newListCategOrProv;181 localStorage.setItem("CasinoModal", JSON.stringify(state.CategOrProvider));182 },183 delAllProvidrCategCasino: (state, action) => {184 state.CategProvidCasinoModal = [];185 localStorage.setItem("CasinoModal", JSON.stringify(state.CategProvidCasinoModal));186 },187 },188 extraReducers: {189 [thunkApiHome.fulfilled]: (state, { payload }) => {190 state.sliderApiHome = payload;191 state.status = "success";192 },193 [LiveCasinoApi.fulfilled]: (state, { payload }) => {194 state.LiveCasino = payload;195 state.status = "success";196 },197 [PrematchApi.fulfilled]: (state, { payload }) => {198 state.PrematchData = payload;199 state.status = "success";200 },201 [CasinoApi.fulfilled]: (state, { payload }) => {202 state.CasinoData = payload;203 state.status = "success";204 },205 },206});207export const {208 addFavorites,209 delFavorites,210 addCategProvid,211 delCategProvid,212 delAllProvidrCateg,213 sortItemCateg,214 addFavouriteCasino,215 delFavouriteCasino,216 addFavouriteCasinoModal,217 delFavoritesCasinoModal,218 addCategProvidCasinoModal,219 delCategProvidCasino,220 delAllProvidrCategCasino,221} = act.actions;...

Full Screen

Full Screen

casino.js

Source:casino.js Github

copy

Full Screen

1(function() {2 var createItem = function(amount, updated) {3 return {4 amount: amount,5 updated: updated6 };7 }8 var casino = {9 updatedPages: [false, false],10 dailies: {11 '26': createItem(1, false),12 '31': createItem(1, false),13 '18': createItem(1, false),14 '19': createItem(1, false),15 '20': createItem(1, false),16 '21': createItem(1, false),17 '2': createItem(1, false),18 '5': createItem(10, false),19 },20 monthlies: {21 '20013': createItem(5, false),22 '20003': createItem(5, false),23 '1039900000': createItem(20, false),24 '1029900000': createItem(50, false),25 '2': createItem(100, false),26 '5': createItem(200, false),27 }28 }29 var casinoData = {30 dailies: {31 '26': 1,32 '31': 1,33 '18': 1,34 '19': 1,35 '20': 1,36 '21': 1,37 '2': 5,38 '5': 1039 },40 monthlies: {41 '20013': 5,42 '20003': 5,43 '1039900000': 20,44 '1029900000': 50,45 '2': 100,46 '5': 20047 }48 }49 window.Casino = {50 Initialize: function(callback) {51 Storage.Get(['casino'], function(response) {52 if(response['casino'] !== undefined) {53 casino = response['casino'];54 } else {55 Storage.Set('casino', casino);56 }57 if(callback !== undefined) {58 callback();59 }60 });61 },62 InitializeDev: function() {63 var response = [];64 Object.keys(casino.dailies).forEach(function(key) {65 response.push(getJquery('dailies', key));66 });67 Object.keys(casino.monthlies).forEach(function(key) {68 response.push(getJquery('monthlies', key));69 });70 response.push(checkCollapse('dailies'));71 response.push(checkCollapse('monthlies'));72 return response;73 },74 Reset: function() {75 var tuples = {};76 Object.keys(casino.dailies).forEach(function(key) {77 if((key === '2' || key === '5') && casino.monthlies[key].amount < casinoData.dailies[key]) {78 tuples[key] = casino.monthlies[key].amount;79 } else {80 tuples[key] = casinoData.dailies[key];81 }82 });83 setCasino(tuples, {}, [false, false]);84 resetUpdated();85 },86 MonthlyReset: function() {87 var tuples = {};88 Object.keys(casino.monthlies).forEach(function(key) {89 tuples[key] = casinoData.monthlies[key];90 });91 setCasino({}, tuples, [false, false]);92 },93 SetCasino1: function(json) {94 var list = json.list;95 var id;96 var dailies = {};97 var monthlies = {};98 for(var i = 0; i < list.length; i++) {99 id = list[i].item_ids[0];100 if(casino.dailies[id] !== undefined) {101 dailies[id] = parseInt(list[i].remain_number);102 }103 if(casino.monthlies[id] !== undefined) {104 monthlies[id] = parseInt(list[i].max_remain.number);105 }106 }107 setCasino(dailies, monthlies, [true, casino.updatedPages[1]]);108 if(json.next === 1 || (casino.updatedPages[0] && casino.updatedPages[1])) {109 checkUpdated();110 }111 },112 SetCasino2: function(json) {113 var list = json.list;114 var shittyIndex;115 var id;116 var dailies = {};117 var monthlies = {};118 for(var i = 10; i < json.count; i++) {119 shittyIndex = "" + i;120 id = list[shittyIndex].item_ids[0];121 if(casino.dailies[id] !== undefined) {122 dailies[id] = parseInt(list[i].remain_number);123 }124 if(casino.monthlies[id] !== undefined) {125 monthlies[id] = parseInt(list[i].max_remain.number);126 }127 }128 setCasino(dailies, monthlies, [casino.updatedPages[0], true]);129 if(json.next === 2 && casino.updatedPages[0] && casino.updatedPages[1]) {130 checkUpdated();131 }132 },133 BuyCasino: function(json, payload) {134 var id = json.article.item_ids[0];135 var dailies = {};136 var monthlies = {};137 if(casino.dailies[id] !== undefined) {138 dailies[id] = casino.dailies[id].amount - parseInt(payload.num);139 }140 if(casino.monthlies[id] !== undefined) {141 monthlies[id] = casino.monthlies[id].amount - parseInt(payload.num);142 }143 console.log(dailies);144 console.log(monthlies);145 setCasino(dailies, monthlies);146 // var id = json.article.name;147 // if(id === 'Half Elixir' || id === 'Soul Berry') {148 // remainingMonthlyItems[id] -= remainingDailyItems[id];149 // if(remainingMonthlyItems[id] < 0) {150 // remainingMonthlyItems[id] = 0;151 // }152 // } else if(remainingMonthlyItems[id] !== undefined) {153 // remainingMonthlyItems[id] = 0;154 // }155 // if(remainingDailyItems[id] !== undefined) {156 // remainingDailyItems[id] = 0;157 // }158 }159 }160 var setCasino = function(dailies, monthlies, updatedPages) {161 var updated = false;162 if(updatedPages !== undefined) {163 for(var i = 0; i < updatedPages.length; i++) {164 if(casino.updatedPages[i] !== updatedPages[i]) {165 casino.updatedPages[i] = updatedPages[i];166 updated = true;167 }168 }169 }170 Object.keys(dailies).forEach(function(key) {171 casino.dailies[key].updated = true;172 if(casino.dailies[key].amount !== dailies[key]) {173 casino.dailies[key].amount = dailies[key];174 Message.PostAll(getJquery('dailies', key));175 Message.PostAll(checkCollapse('dailies'));176 updated = true;177 }178 });179 Object.keys(monthlies).forEach(function(key) {180 casino.monthlies[key].updated = true;181 if(casino.monthlies[key].amount !== monthlies[key]) {182 casino.monthlies[key].amount = monthlies[key];183 Message.PostAll(getJquery('monthlies', key));184 Message.PostAll(checkCollapse('monthlies'));185 updated = true;186 }187 });188 //console.log(JSON.stringify(casino));189 if(updated) {190 Storage.Set('casino', casino);191 }192 }193 var checkCollapse = function(type) {194 var collapse = true;195 var keys = Object.keys(casino[type]);196 for(var i = 0; i < keys.length; i++) {197 if(casino[type][keys[i]].amount !== 0) {198 collapse = false;199 }200 }201 return {'collapsePanel':{202 'id': '#collapse-casino-' + type,203 'value': collapse204 }};205 }206 var getJquery = function(type, key) {207 var id = '#casino-' + type + '-' + key;208 return {'setText': {209 'id': '#casino-' + type + '-' + key,210 'value': casino[type][key].amount + '/' + casinoData[type][key]211 }};212 }213 var resetUpdated = function() {214 Object.keys(casino.dailies).forEach(function(key) {215 casino.dailies[key].updated = false;216 });217 Object.keys(casino.monthlies).forEach(function(key) {218 casino.monthlies[key].updated = false;219 });220 Storage.Set('casino', casino);221 }222 var checkUpdated = function() {223 var dailies = {};224 var monthlies = {};225 Object.keys(casino.dailies).forEach(function(key) {226 if(!casino.dailies[key].updated) {227 dailies[key] = 0;228 }229 });230 Object.keys(casino.monthlies).forEach(function(key) {231 if(!casino.monthlies[key].updated) {232 monthlies[key] = 0;233 }234 });235 setCasino(dailies, monthlies, [false, false]);236 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var strykerParent = require('stryker-parent');2strykerParent.casino();3var strykerParent = require('stryker-parent');4strykerParent.casino();5var strykerParent = require('stryker-parent');6strykerParent.casino();7var strykerParent = require('stryker-parent');8strykerParent.casino();9var strykerParent = require('stryker-parent');10strykerParent.casino();11var strykerParent = require('stryker-parent');12strykerParent.casino();13var strykerParent = require('stryker-parent');14strykerParent.casino();15var strykerParent = require('stryker-parent');16strykerParent.casino();17var strykerParent = require('stryker-parent');18strykerParent.casino();19var strykerParent = require('stryker-parent');20strykerParent.casino();21var strykerParent = require('stryker-parent');22strykerParent.casino();23var strykerParent = require('stryker-parent');24strykerParent.casino();25var strykerParent = require('stryker-parent');26strykerParent.casino();27var strykerParent = require('stryker-parent');

Full Screen

Using AI Code Generation

copy

Full Screen

1var casino = require('stryker-parent').casino;2casino('test.js');3var casino = require('stryker-parent').casino;4casino('test.js');5var casino = require('stryker-parent').casino;6casino('test.js');7var casino = require('stryker-parent').casino;8casino('test.js');9var casino = require('stryker-parent').casino;10casino('test.js');11var casino = require('stryker-parent').casino;12casino('test.js');13var casino = require('stryker-parent').casino;14casino('test.js');15var casino = require('stryker-parent').casino;16casino('test.js');17var casino = require('stryker-parent').casino;18casino('test.js');19var casino = require('stryker-parent').casino;20casino('test.js');21var casino = require('stryker-parent').casino;22casino('test.js');23var casino = require('stryker-parent').casino;24casino('test.js');25var casino = require('stryker-parent').casino;26casino('test.js');27var casino = require('stryker-parent').casino;28casino('test.js');

Full Screen

Using AI Code Generation

copy

Full Screen

1var casino = require('stryker-parent/casino');2casino.play();3exports.casino = require('./lib/casino');4exports.play = function () {5 console.log('Playing casino');6};7exports.casino = require('./casino');

Full Screen

Using AI Code Generation

copy

Full Screen

1var casino = require('stryker-parent').casino;2casino('test');3var casino = require('stryker-parent').casino;4casino('test');5var casino = require('stryker-parent').casino;6casino('test');7var casino = require('stryker-parent').casino;8casino('test');9var casino = require('stryker-parent').casino;10casino('test');11var casino = require('stryker-parent').casino;12casino('test');13var casino = require('stryker-parent').casino;14casino('test');15var casino = require('stryker-parent').casino;16casino('test');17var casino = require('stryker-parent').casino;18casino('test');19var casino = require('stryker-parent').casino;20casino('test');21var casino = require('stryker-parent').casino;22casino('test');23var casino = require('stryker-parent').casino;24casino('test');25var casino = require('stryker-parent').casino;26casino('test');27var casino = require('stryker-parent').casino;28casino('test');

Full Screen

Using AI Code Generation

copy

Full Screen

1var casino = require('stryker-parent');2console.log(casino());3{4 "dependencies": {5 }6}

Full Screen

Using AI Code Generation

copy

Full Screen

1var strykerParent = require('stryker-parent');2var stryker = strykerParent({3});4var stryker = require('stryker')({5});6var stryker = require('stryker-api').stryker({7});8var stryker = require('stryker-cli').stryker({9});10var stryker = require('stryker-html-reporter').stryker({11});12var stryker = require('stryker-jasmine').stryker({13});14var stryker = require('stryker-jasmine-runner').stryker({15});16var stryker = require('stryker-mocha-runner').stryker({17});18var stryker = require('stryker-mutator').stryker({19});20var stryker = require('stryker-stryker').stryker({21});22var stryker = require('stryker-typescript').stryker({23});24var stryker = require('stryker-webpack-transpiler').stryker({25});26var stryker = require('stryker')({27});28var stryker = require('stryker-api').stryker({29});30var stryker = require('stryker-cli').stryker({31});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run stryker-parent automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful