jQuery.ui.autocomplete.prototype._resizeMenu = function () { this.menu.element.css("min-width", this.element.outerWidth()); this.menu.element.css("max-width", Math.max(this.element.outerWidth(), (this.menu.element.parent().outerWidth() - this.element.offset().left - 10))); }; var App_localeMap = new Array(); App_localeMap["en"] = {description:"English"};App_localeMap["th"] = {description:"Thai"};App_localeMap["id"] = {description:"Indonesia"};App_localeMap["zh_CN"] = {description:"Simplified Chinese"};App_localeMap["zh_HK"] = {description:"Traditional Chinese (Hong Kong)"};App_localeMap["zh_TW"] = {description:"Traditional Chinese (Taiwan)"}; var App_isLoopRunning = true; var App_unreadNotificationCount = 0; var App_unreadTeamInviteRequestCount = 0; var App_unreadTeamJoinRequestCount = 0; function App_init() { //App_loop(); } function App_endLoop() { App_isLoopRunning = false; } function App_loop() { if(!App_isLoopRunning) { return; } setTimeout(App_loop, 15000);//15 seconds } function App_convertBooleanToString(value) { return (value ? true : false); } function App_convertStringToBoolean(content) { return (content === "true"); } function App_convertBrToNl(content) { return content.replace(//gi, "\n"); } function App_convertNLtoBr(content) { return content.replace(/(?:\r\n|\r|\n)/g, "
"); } function App_encodeHtmlEntities(content) { return content.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"); } function App_getScreenHeight() { return $(window).height(); } function App_getScreenWidth() { return $(window).width(); } function App_getDateStringWithYearAndMonthAndDay(year, month, day) { if(year == null || month == null || day == null) { return null; } var output = year; output += '-'; if(month.length < 2) { output += '0'; } output += month; output += '-'; if(day.length < 2) { output += '0'; } output += day; return output; } function App_getDatePickerFormatValue($element, format) { var date = $element.data("DateTimePicker").date(); if(date == null) { return ""; } return date.format(format); } function App_getDatePickerFormatDateValue($element) { return App_getDatePickerFormatValue($element, "YYYY-MM-DD"); } /* function App_getDatePickerFormatDateTimeValue($element) { return App_getDatePickerFormatValue($element, "YYYY-MM-DD kk:mm:ss"); } function App_getDatePickerFormatDateTimeWithTimezoneValue($element) { return App_getDatePickerFormatDateTimeValue($element) + App_getDatePickerFormatValue($element, "ZZ").substr(0 ,3); } */ function App_getDatePickerFormatTimeValue($element) { return App_getDatePickerFormatValue($element, "kk:mm:ss"); } function App_getDatePickerFormatISO8601Value($element) { return App_getDatePickerFormatValue($element, null); } function App_diffNowAndMomentDateInDays(date) { return new moment().diff(date, 'days'); } function App_addMomentDateSecond(date, value) { return date.add('second', value); } function App_subtractMomentDateSecond(date, value) { return date.subtract('second', value); } function App_convertISO8601StringToDate(date) { return new moment(date); } function App_convertDateStringToDate(date) { return new moment(date, 'YYYY-MM-DD'); } function App_convertTimeStringToDate(time) { return new moment(time, 'HH:mm:ssZZ'); } function App_getDateWithTimeZoneOffset(timezoneOffset) { return new moment().utcOffset(timezoneOffset); } function App_getFormatDateString(date, format) { return new moment(date).format(format); } function App_getLastDayOfMonth(date) { return parseInt(date.endOf("month").format("DD")); } function App_getFormatISO8601String(date) { return App_getFormatDateString(date, null); } function App_getFormatLocaleDateString(date) { return App_getFormatDateString(date, "LL"); } function App_getFormatLocaleDateTimeString(date) { return App_getFormatDateString(date, "LLL"); } function App_getFormatLocaleDateTimeStringWithTimezone(date) { return App_getFormatDateString(date, "LLL") + " (GMT" + App_getFormatDateString(date, "ZZ").substr(0 ,3) + ")"; } function App_getFormatLocaleDateTimeWeekString(date) { return App_getFormatDateString(date, "LLLL"); } function App_getFormatSlashDate(date) { return App_getFormatDateString(date, "YYYY/MM/DD"); } function App_getFormatSlashDateHourMinute(date) { return App_getFormatDateString(date, "YYYY/MM/DD HH:mm"); } function App_getFormatSlashDateHourMinuteWithTimezone(date) { return App_getFormatDateString(date, "YYYY/MM/DD HH:mm") + " (GMT" + App_getFormatDateString(date, "ZZ").substr(0 ,3) + ")"; } function App_getFormatSlashDateHourMinuteSecond(date) { return App_getFormatDateString(date, "YYYY/MM/DD HH:mm:ss"); } function App_getFormatSlashDateHourMinuteSecondWithTimezone(date) { return App_getFormatDateString(date, "YYYY/MM/DD HH:mm:ss") + " (GMT" + App_getFormatDateString(date, "ZZ").substr(0 ,3) + ")"; } function App_getFormatDate(date) { return App_getFormatDateString(date, "YYYY-MM-DD"); } function App_getFormatHourMinute(date) { return App_getFormatDateString(date, "HH:mm"); } function App_isDateAfterAnother(date, anotherDate) { return new moment(date).isAfter(new moment(anotherDate)); } function App_isDateBeforeAnother(date, anotherDate) { return new moment(date).isBefore(new moment(anotherDate)); } function App_isDateBetweenAnothers(date, anotherDate1, anotherDate2) { return new moment(date).isBetween(new moment(anotherDate1), new moment(anotherDate2)); } function App_isDateEqualToday(date) { return App_getFormatSlashDate(date) == App_getFormatSlashDate(new Date()); } function App_isDateInEarlyMorning(date) { var momentDate = new moment(date); if(momentDate.hour() == 0 && momentDate.minute() == 0 && momentDate.second() == 0) { return true; } return false } function App_getFormatNumberString(number, format) { return numeral(number).format(format); } function App_getFormatDisplayNumberString(number, fix) { var format = "0,0"; if(fix != null && fix > 0) { format += "."; for(var i = 0; i < fix; ++i) { format += "0"; } } return App_getFormatNumberString(number, format); } function App_getFormatDisplayNumberInMaxFractionDigitsString(number, maxFix) { var format = "0,0"; if(maxFix != null && maxFix > 0) { format += "[.]"; for(var i = 0; i < maxFix; ++i) { format += "0"; } } return App_getFormatNumberString(number, format); } function App_getUnformatNumber(number) { return numeral().unformat(number); } function App_getDisplayString(content) { if(!System_checkIsEmptyString(content)) { return content; } return App_getNotDefinedString(); } function App_getNotDefinedString() { return "--"; } function App_omitString(content, maxLength) { if(content == null) { return ""; } if(content.length <= maxLength) { return content; } return content.substr(0, maxLength) + "..."; } function App_mergeStringArray(contents, maxLength, divider) { if(maxLength == null) { maxLength = contents.length; } if(divider == null) { divider = ", "; } var output = ""; for(var i = 0; i < Math.min(contents.length, maxLength); ++i) { var content = contents[i]; if(content == null) { continue; } if(i > 0) { output += divider; } output += content; } if(contents.length > maxLength) { //output = App_omitString(output, maxLength); output += "..."; } return output; } function App_limitImageSize(size, limitWidth, limitHeight) { var widthRatio = 1; if(limitWidth != null) { widthRatio = limitWidth / size.width; } var heightRatio = 1; if(limitHeight != null) { heightRatio = limitHeight / size.height; } var ratio = ((widthRatio < heightRatio) ? widthRatio : heightRatio); ratio = Math.min(ratio, 1); return { width:(size.width * ratio), height:(size.height * ratio) }; } function App_limitUploadImageSize(size) { return App_limitImageSize(size, 2048, 2048); } function App_checkBrowserIsIOS() { return (/iPhone|iPad|iPod/i.test(navigator.userAgent)); } function App_getRedirectToConsolesManageCreatePageUrl() { return "https://vs.cga.gg/consoles/manage/create"; } function App_redirectToConsolesManageCreatePage() { window.location = App_getRedirectToConsolesManageCreatePageUrl(); } function App_gotoConsolesManageCreatePage() { $.mobile.changePage(App_getRedirectToConsolesManageCreatePageUrl()); } function App_getRedirectToConsoleManageEditPageUrl(consoleId) { return "https://vs.cga.gg/console/%3CconsoleId%3E/manage/edit".replace("%3CconsoleId%3E", consoleId); } function App_gotoConsoleManageEditPage(consoleId) { $.mobile.changePage(App_getRedirectToConsoleManageEditPageUrl(consoleId)); } function App_getRedirectToCouponInfoPageUrl(id) { return "https://vs.cga.gg/coupon/" + id; } function App_redirectToCouponInfoPage(id) { window.location = App_getRedirectToCouponInfoPageUrl(id); } function App_getRedirectToCouponTypeGetPageUrl(code) { return "https://vs.cga.gg/coupon_type//get/" + code; } function App_redirectToCouponTypeGetPage(code) { window.location = App_getRedirectToCouponTypeGetPageUrl(code); } function App_getRedirectToFeedIndexPageUrl(feedId) { return "https://vs.cga.gg/feed/" + feedId; } function App_redirectToFeedIndexPage(feedId) { window.location = App_getRedirectToFeedIndexPageUrl(feedId); } function App_getRedirectToFriendFinderPageUrl() { return "https://vs.cga.gg/friend/finder"; } function App_redirectToFriendFinderPage() { window.location = App_getRedirectToFriendFinderPageUrl(); } function App_getRedirectToGamesManageCreatePageUrl() { return "https://vs.cga.gg/games/manage/create"; } function App_redirectToGamesManageCreatePage() { window.location = App_getRedirectToGamesManageCreatePageUrl(); } function App_gotoGamesManageCreatePage() { $.mobile.changePage(App_getRedirectToGamesManageCreatePageUrl()); } function App_getRedirectToGameManageEditPageUrl(gameId) { return "https://vs.cga.gg/game/%3CgameId%3E/manage/edit".replace("%3CgameId%3E", gameId); } function App_gotoGameManageEditPage(gameId) { $.mobile.changePage(App_getRedirectToGameManageEditPageUrl(gameId)); } function App_getRedirectToGameManageOptionEditPageUrl(gameId, optionId) { return "https://vs.cga.gg/game/%3CgameId%3E/manage/option/%3CoptionId%3E/edit".replace("%3CgameId%3E", gameId).replace("%3CoptionId%3E", optionId); } function App_gotoGameManageOptionEditPage(gameId, optionId) { $.mobile.changePage(App_getRedirectToGameManageOptionEditPageUrl(gameId, optionId)); } function App_getRedirectToGameManageOptionsCreatePageUrl(gameId) { return "https://vs.cga.gg/game/%3CgameId%3E/manage/options/create".replace("%3CgameId%3E", gameId); } function App_gotoGameManageOptionsCreatePage(gameId) { $.mobile.changePage(App_getRedirectToGameManageOptionsCreatePageUrl(gameId)); } function App_getRedirectToGameManageOptionsEditPageUrl(gameId, optionId) { return "https://vs.cga.gg/game/%3CgameId%3E/manage/option/%3CoptionId%3E/edit".replace("%3CgameId%3E", gameId).replace("%3CoptionId%3E", optionId); } function App_redirectToGameManageOptionsEditPage(gameId, optionId) { window.location = App_getRedirectToGameManageOptionsEditPageUrl(gameId, optionId); } function App_getRedirectToGameManageOptionIndexPageUrl(gameId) { return "https://vs.cga.gg/game/%3CgameId%3E/manage/options".replace("%3CgameId%3E", gameId); } function App_redirectToGameManageOptionIndexPage(gameId) { window.location = App_getRedirectToGameManageOptionIndexPageUrl(gameId); } function App_getRedirectToGiftcardRedeemPageUrl() { return "https://vs.cga.gg/giftcard/redeem"; } function App_redirectToGiftcardRedeemPage() { window.location = App_getRedirectToGiftcardRedeemPageUrl(); } function App_getRedirectToIndexPageUrl() { return "https://vs.cga.gg"; } function App_redirectToIndexPage() { window.location = App_getRedirectToIndexPageUrl(); } function App_gotoIndexPage() { $.mobile.changePage(App_getRedirectToIndexPageUrl()); } function App_getRedirectToLadderInfoPageUrl(ladderId) { return "https://vs.cga.gg/ladder/" + ladderId; } function App_redirectToLadderInfoPage(ladderId) { window.location = App_getRedirectToLadderInfoPageUrl(ladderId); } function App_getRedirectToMatchPageUrl(matchId) { return "https://vs.cga.gg/match/" + matchId; } function App_redirectToMatchPage(matchId) { window.location = App_getRedirectToMatchPageUrl(matchId); } function App_getRedirectToShopPageUrl(shopId) { return "https://vs.cga.gg/shop/%3CshopId%3E".replace("%3CshopId%3E", shopId); } function App_redirectToShopPage(shopId) { window.location = App_getRedirectToShopPageUrl(shopId); } function App_getRedirectToShopItemPageUrl(shopId, itemId) { return "https://vs.cga.gg/shop/%3CshopId%3E/item/%3CitemId%3E".replace("%3CshopId%3E", shopId).replace("%3CitemId%3E", itemId); } function App_redirectToShopItemPage(shopId, itemId) { window.location = App_getRedirectToShopItemPageUrl(shopId, itemId); } function App_getRedirectToShopsManageCreatePageUrl() { return "https://vs.cga.gg/shops/manage/create"; } function App_redirectToShopsManageCreatePage() { window.location = App_getRedirectToShopsManageCreatePageUrl(); } function App_getRedirectToShopManageEditPageUrl(shopId) { return "https://vs.cga.gg/shop/%3CshopId%3E/manage/edit".replace("%3CshopId%3E", shopId); } function App_redirectToShopManageEditPage(shopId) { window.location = App_getRedirectToShopManageEditPageUrl(shopId); } function App_getRedirectToShopManageAdministratorIndexPageUrl(shopId) { return "https://vs.cga.gg/shop/%3CshopId%3E/manage/administrators".replace("%3CshopId%3E", shopId); } function App_redirectToShopManageAdministratorIndexPage(shopId) { window.location = App_getRedirectToShopManageAdministratorIndexPageUrl(shopId); } function App_getRedirectToShopManageItemCreatePageUrl(shopId) { return "https://vs.cga.gg/shop/%3CshopId%3E/manage/items/create".replace("%3CshopId%3E", shopId); } function App_redirectToShopManageItemCreatePage(shopId) { window.location = App_getRedirectToShopManageItemCreatePageUrl(shopId); } function App_getRedirectToShopManageItemEditPageUrl(shopId, itemId) { return "https://vs.cga.gg/shop/%3CshopId%3E/manage/item/%3CitemId%3E/edit".replace("%3CshopId%3E", shopId).replace("%3CitemId%3E", itemId); } function App_redirectToShopManageItemEditPage(shopId, itemId) { window.location = App_getRedirectToShopManageItemEditPageUrl(shopId, itemId); } function App_getRedirectToShopManageItemsIndexPageUrl(shopId) { return "https://vs.cga.gg/shop/%3CshopId%3E/manage/items".replace("%3CshopId%3E", shopId); } function App_redirectToShopManageItemsIndexPage(shopId) { window.location = App_getRedirectToShopManageItemsIndexPageUrl(shopId); } function App_getRedirectToShopManageOrderEditPageUrl(shopId, orderId) { return "https://vs.cga.gg/shop/%3CshopId%3E/manage/order/%3CorderId%3E/edit".replace("%3CshopId%3E", shopId).replace("%3CorderId%3E", orderId); } function App_redirectToShopManageOrderEditPage(shopId, orderId) { window.location = App_getRedirectToShopManageOrderEditPageUrl(shopId, orderId); } function App_getRedirectToShopManageOrdersPageUrl(shopId) { return "https://vs.cga.gg/shop/%3CshopId%3E/manage/orders".replace("%3CshopId%3E", shopId); } function App_redirectToShopManageOrdersPage(shopId) { window.location = App_getRedirectToShopManageOrdersPageUrl(shopId); } function App_getRedirectToShoppingcartOrderPageUrl() { return "https://vs.cga.gg/shoppingcart/order"; } function App_redirectToShoppingcartOrderPage() { window.location = App_getRedirectToShoppingcartOrderPageUrl(); } function App_getRedirectToUserPageUrl(userId) { return "https://vs.cga.gg/user/" + userId; } function App_redirectToUserPage(userId) { window.location = App_getRedirectToUserPageUrl(userId); } function App_goToUserPage(userId) { $.mobile.changePage(App_getRedirectToUserPageUrl(userId)); } function App_getRedirectToUserCreateGettingStartedPageUrl() { return "https://vs.cga.gg/user/create_getting_started"; } function App_redirectToUserCreateGettingStartedPage() { window.location = App_getRedirectToUserCreateGettingStartedPageUrl(); } function App_getRedirectToUserLoginPageUrl(nextUrl, email) { var url = "https://vs.cga.gg/user/login"; if(!System_checkIsEmptyString(nextUrl)) { url = System_setUrlParameter(url, "next_url", encodeURIComponent(nextUrl)); } if(!System_checkIsEmptyString(email)) { url = System_setUrlParameter(url, "email", encodeURIComponent(email)); } return url; } function App_redirectToUserLoginPage(nextUrl, email) { window.location = App_getRedirectToUserLoginPageUrl(nextUrl, email); } function App_newWindowToUserLoginPage(nextUrl, email) { window.open(App_getRedirectToUserLoginPageUrl(nextUrl, email), "", "width=650,height=500"); } function App_getRedirectToUserPhotosPageUrl(userId) { return "https://vs.cga.gg/user/photos/" + userId; } function App_redirectToUserPhotosPage(userId) { window.location = App_getRedirectToUserPhotosPageUrl(userId); } function App_getRedirectToUserSettingPageUrl() { return "https://vs.cga.gg/user/edit_profile"; } function App_redirectToUserSettingPage() { window.location = App_getRedirectToUserSettingPageUrl(); } function App_goToUserSettingPage() { $.mobile.changePage(App_getRedirectToUserSettingPageUrl()); } function App_getRedirectToUserSettingPageContactTagUrl() { return App_getRedirectToUserSettingPageUrl() + "#contact"; } function App_redirectToUserSettingPageContactTag() { window.location = App_getRedirectToUserSettingPageContactTagUrl(); } function App_getRedirectToUserSettingPageProfilePhotoTagUrl() { return App_getRedirectToUserSettingPageUrl() + "#profile_photo"; } function App_redirectToUserSettingPageProfilePhotoTag() { window.location = App_getRedirectToUserSettingPageProfilePhotoTagUrl(); } function App_getRedirectToUserSettingPageSetGameTagUrl() { return App_getRedirectToUserSettingPageUrl() + "#set_game"; } function App_redirectToUserSettingPageSetGameTag() { window.location = App_getRedirectToUserSettingPageSetGameTagUrl(); } function App_getRedirectToUserResetPasswordPageUrl() { return "https://vs.cga.gg/user/reset_password"; } function App_redirectToUserResetPasswordPage() { window.location = App_getRedirectToUserResetPasswordPageUrl(); } function App_getRedirectToUserEditProfilePageUrl() { return "https://vs.cga.gg/user/edit_profile"; } function App_redirectToUserEditProfilePage() { window.location = App_getRedirectToUserEditProfilePageUrl(); } function App_getRedirectToUserEditProfilePageLiveTagUrl() { return App_getRedirectToUserEditProfilePageUrl() + "#live"; } function App_gotoUserEditProfilePageLiveTag() { //$.mobile.changePage(App_getRedirectToUserEditProfilePageLiveTagUrl()); $.mobile.changePage(App_getRedirectToUserEditProfilePageLiveTagUrl(), {changeHash:false}); window.history.pushState({}, null, App_getRedirectToUserEditProfilePageLiveTagUrl()); } function App_getRedirectToTeamPageUrl() { return "https://vs.cga.gg/team"; } function App_redirectToTeamPage() { window.location = App_getRedirectToTeamPageUrl(); } function App_getRedirectToTeamPageReceivedRequestTagUrl(tournamentId) { return App_getRedirectToTeamPageUrl() + "#received_request"; } function App_redirectToTeamPageReceivedRequestTag() { window.location = App_getRedirectToTeamPageReceivedRequestTagUrl(); } function App_gotoTeamPageReceivedRequestTag() { //$.mobile.changePage(App_getRedirectToTeamPageReceivedRequestTagUrl()); $.mobile.changePage(App_getRedirectToTeamPageReceivedRequestTagUrl(), {changeHash:false}); window.history.pushState({}, null, App_getRedirectToTeamPageReceivedRequestTagUrl()); } function App_getRedirectToTeamCreatePageUrl() { return "https://vs.cga.gg/team/create"; } function App_redirectToTeamCreatePage() { window.location = App_getRedirectToTeamCreatePageUrl(); } function App_goToTeamCreatePage() { $.mobile.changePage(App_getRedirectToTeamCreatePageUrl()); } function App_getRedirectToTeamCreatePageUrlWithNextUrl(nextUrl) { var url = App_getRedirectToTeamCreatePageUrl(); if(!System_checkIsEmptyString(nextUrl)) { url = System_setUrlParameter(url, "next_url", encodeURIComponent(nextUrl)); } return url; } function App_redirectToTeamCreatePageWithNextUrl(nextUrl) { window.location = App_getRedirectToTeamCreatePageUrlWithNextUrl(nextUrl); } function App_getRedirectToTeamCreateGettingStartedPageUrl(teamId) { return "https://vs.cga.gg/team/create_getting_started/" + teamId; } function App_redirectToTeamCreateGettingStartedPage(teamId) { window.location = App_getRedirectToTeamCreateGettingStartedPageUrl(teamId); } function App_gotoTeamCreateGettingStartedPage(teamId) { $.mobile.changePage(App_getRedirectToTeamCreateGettingStartedPageUrl(teamId)); } function App_getRedirectToTeamInfoPageUrl(teamId) { return "https://vs.cga.gg/team/" + teamId; } function App_redirectToTeamInfoPage(teamId) { window.location = App_getRedirectToTeamInfoPageUrl(teamId); } function App_gotoTeamInfoPage(teamId) { $.mobile.changePage(App_getRedirectToTeamInfoPageUrl(teamId)); } function App_getRedirectToTournamentInfoPageUrl(tournamentId) { return "https://vs.cga.gg/tournament/" + tournamentId; } function App_redirectToTournamentInfoPage(tournamentId) { window.location = App_getRedirectToTournamentInfoPageUrl(tournamentId); } function App_getRedirectToTournamentInfoPageKnockoutStageTagUrl(tournamentId) { return App_getRedirectToTournamentInfoPageUrl(tournamentId) + "#knockout_stage"; } function App_redirectToTournamentInfoPageKnockoutStageTag(tournamentId) { window.location = App_getRedirectToTournamentInfoPageKnockoutStageTagUrl(tournamentId); } function App_getRedirectToTournamentInfoPageSignupTagUrl(tournamentId) { return App_getRedirectToTournamentInfoPageUrl(tournamentId) + "#signup"; } function App_redirectToTournamentInfoPageSignupTag(tournamentId) { window.location = App_getRedirectToTournamentInfoPageSignupTagUrl(tournamentId); } function App_getRedirectToTournamentSignupPayPaymePageUrl(tournamentId) { return "https://vs.cga.gg/tournament/%3CtournamentId%3E/signup/pay/payme".replace("%3CtournamentId%3E", tournamentId); } function App_redirectToTournamentSignupPayPaymePage(tournamentId) { window.location = App_getRedirectToTournamentSignupPayStripePageUrl(tournamentId); } function App_getRedirectToTournamentSignupPayStripePageUrl(tournamentId) { return "https://vs.cga.gg/tournament/%3CtournamentId%3E/signup/pay/stripe".replace("%3CtournamentId%3E", tournamentId); } function App_redirectToTournamentSignupPayStripePage(tournamentId) { window.location = App_getRedirectToTournamentSignupPayStripePageUrl(tournamentId); } function App_getRedirectToTournamentManageBracketsCreatePageUrl(tournamentId) { return "https://vs.cga.gg/tournament/%3CtournamentId%3E/manage/brackets/create".replace("%3CtournamentId%3E", tournamentId); } function App_redirectToTournamentManageBracketsCreatePage(tournamentId) { window.location = App_getRedirectToTournamentManageBracketsCreatePageUrl(tournamentId); } function App_gotoTournamentManageBracketsCreatePage(tournamentId) { $.mobile.changePage(App_getRedirectToTournamentManageBracketsCreatePageUrl(tournamentId)); } function App_getRedirectToTournamentManageBracketEditPageUrl(tournamentId, bracketId) { return "https://vs.cga.gg/tournament/%3CtournamentId%3E/manage/bracket/%3CbracketId%3E/edit".replace("%3CtournamentId%3E", tournamentId).replace("%3CbracketId%3E", bracketId); } function App_redirectToTournamentManageBracketEditPage(tournamentId, bracketId) { window.location = App_getRedirectToTournamentManageBracketEditPageUrl(tournamentId, bracketId); } function App_getRedirectToTournamentManageBracketIndexPage(tournamentId) { return "https://vs.cga.gg/tournament/%3CtournamentId%3E/manage/brackets".replace("%3CtournamentId%3E", tournamentId); } function App_redirectToTournamentManageBracketIndexPage(tournamentId) { window.location = App_getRedirectToTournamentManageBracketIndexPage(tournamentId); } function App_getRedirectToTournamentManageAdministratorIndexPage(tournamentId) { return "https://vs.cga.gg/tournament/%3CtournamentId%3E/manage/administrators".replace("%3CtournamentId%3E", tournamentId); } function App_redirectToTournamentManageAdministratorIndexPage(tournamentId) { window.location = App_getRedirectToTournamentManageAdministratorIndexPage(tournamentId); } function App_getRedirectToTournamentManageCompetitorEditPage(tournamentId, competitorId) { return "https://vs.cga.gg/tournament/%3CtournamentId%3E/manage/competitor/%3CcompetitorId%3E/edit".replace("%3CtournamentId%3E", tournamentId).replace("%3CcompetitorId%3E", competitorId); } function App_redirectToTournamentManageCompetitorEditPage(tournamentId, competitorId) { window.location = App_getRedirectToTournamentManageCompetitorEditPage(tournamentId, competitorId); } function App_getRedirectToTournamentManageCompetitorEditTeamMatchPlayersPageUrl(tournamentId, competitorId) { return "https://vs.cga.gg/tournament/%3CtournamentId%3E/manage/competitor/%3CcompetitorId%3E/edit_team_match_players".replace("%3CtournamentId%3E", tournamentId).replace("%3CcompetitorId%3E", competitorId); } function App_redirectToTournamentManageCompetitorEditTeamMatchPlayersPage(tournamentId, competitorId) { window.location = App_getRedirectToTournamentManageCompetitorEditTeamMatchPlayersPageUrl(tournamentId, competitorId); } function App_getRedirectToTournamentManageCompetitorIndexPage(tournamentId) { return "https://vs.cga.gg/tournament/%3CtournamentId%3E/manage/competitors".replace("%3CtournamentId%3E", tournamentId); } function App_redirectToTournamentManageCompetitorIndexPage(tournamentId) { window.location = App_getRedirectToTournamentManageCompetitorIndexPage(tournamentId); } function App_gotoTournamentManageCompetitorIndexPage(tournamentId) { $.mobile.changePage(App_getRedirectToTournamentManageCompetitorIndexPage(tournamentId)); } function App_getRedirectToTournamentManageCompetitorIndexPageSpecificDivisionTag(tournamentId, specificDivisionId) { return App_getRedirectToTournamentManageCompetitorIndexPage(tournamentId) + "#division_" + specificDivisionId; } function App_redirectToTournamentManageCompetitorIndexPageSpecificDivisionTag(tournamentId, specificDivisionId) { window.location = App_getRedirectToTournamentManageCompetitorIndexPageSpecificDivisionTag(tournamentId, specificDivisionId); } function App_getRedirectToTournamentsManageCreatePage(gameId, refTournamentId) { var url = "https://vs.cga.gg/tournaments/manage/create"; if(!System_checkIsEmptyString(gameId)) { url = System_setUrlParameter(url, "game_id", encodeURIComponent(gameId)); } if(!System_checkIsEmptyString(refTournamentId)) { url = System_setUrlParameter(url, "ref_tournament_id", encodeURIComponent(refTournamentId)); } return url; } function App_redirectToTournamentsManageCreatePage(gameId) { window.location = App_getRedirectToTournamentsManageCreatePage(gameId); } function App_gotoTournamentsManageCreatePage(gameId) { $.mobile.changePage(App_getRedirectToTournamentsManageCreatePage(gameId)); } function App_getRedirectToTournamentManageEditPage(tournamentId) { return "https://vs.cga.gg/tournament/%3CtournamentId%3E/manage/edit".replace("%3CtournamentId%3E", tournamentId); } function App_redirectToTournamentManageEditPage(tournamentId) { window.location = App_getRedirectToTournamentManageEditPage(tournamentId); } function App_getRedirectToAjaxPublicCompetitorExtraConfigPageUrl(tournamentId, partyId) { return "https://vs.cga.gg/tournament/ajax_public_competitor_extra_config?tournament_id=" + tournamentId + "&party_id=" + partyId; } function App_redirectToFacebookAuthorizationPage() { window.location = "https:\/\/www.facebook.com\/v2.10\/dialog\/oauth?client_id=983638428444395&state=b24ad57a793f42cfd24af4be5beaa4c8&response_type=code&sdk=php-sdk-5.6.1&redirect_uri=https%3A%2F%2Fvs.cga.gg%2Fexternal%2Ffacebook%2Flogin&scope=email"; } function App_redirectToTwitchAuthorizationPage() { window.location = "https:\/\/id.twitch.tv\/oauth2\/authorize?response_type=code&client_id=k34e0llydgfgoaols2hujqvqeqjiv5&redirect_uri=https:\/\/vs.cga.gg\/external\/twitch\/login&scope=user:read:email+viewing_activity_read"; } function App_newWindowForImgSrc(src) { var newWindow = window.open(); /* newWindow.document.body.innerHTML = ''; newWindow.document.body.style.background = '#0e0e0e'; newWindow.document.body.style.margin = '0'; newWindow.document.body.style.padding = '0'; newWindow.document.body.style.textAlign = 'center'; */ newWindow.document.open(); newWindow.document.write(''); newWindow.document.close(); } function App_getSysMessageWithSourceStringAndParameter(message, parameter) { return App_getSysMessageWithSourceStringAndParameters(message, [parameter]); } function App_getSysMessageWithSourceStringAndParameters(message, parameters) { for(var i = 0; i < parameters.length; ++i) { message = message.replace("%@", parameters[i]); } var parametersKeys = Object.keys(parameters); for(var parametersKeysIndex = 0; parametersKeysIndex < parametersKeys.length; ++parametersKeysIndex) { var parametersKey = parametersKeys[parametersKeysIndex]; message = message.replace(("$" + parametersKey), parameters[parametersKey]); } return message; } function App_getHtmlSysMessageWithSourceString(message) { return App_convertNLtoBr(message); } function App_getHtmlSysMessageWithSourceStringAndParameter(message, parameter) { message = App_getSysMessageWithSourceStringAndParameter(message, parameter); message = App_convertNLtoBr(message); return message; } function App_getHtmlSysMessageWithSourceStringAndParameters(message, parameters) { message = App_getSysMessageWithSourceStringAndParameters(message, parameters); message = App_convertNLtoBr(message); return message; } function App_getApiFeedDeleteUrl(feedId) { return "https://vs.cga.gg/api/feed/%3CfeedId%3E/delete".replace("%3CfeedId%3E", feedId); } function App_getApiFeedCommentsUrl(feedId) { return "https://vs.cga.gg/api/feed/%3CfeedId%3E/comments".replace("%3CfeedId%3E", feedId); } function App_getApiFeedCommentCreateUrl(feedId) { return "https://vs.cga.gg/api/feed/%3CfeedId%3E/comment/create".replace("%3CfeedId%3E", feedId); } function App_getApiTournamentTeamPlayersUrl(tournamentId, teamId) { return "https://vs.cga.gg/api/tournament/%3CtournamentId%3E/team/%3CteamId%3E/players".replace("%3CtournamentId%3E", tournamentId).replace("%3CteamId%3E", teamId); } function App_getApiUserGameAccountsUrl(userId) { return "https://vs.cga.gg/api/user/%3CuserId%3E/game_accounts".replace("%3CuserId%3E", userId); } function App_getApiUserUserInfoUrl(userId) { return "https://vs.cga.gg/api/user/%3CuserId%3E".replace("%3CuserId%3E", userId); } function App_getAbsolutePosition($element) { var el = $element[0]; var found, left = 0, top = 0, width = 0, height = 0, offsetBase = util.getAbsolutePosition.offsetBase; if (!offsetBase && document.body) { offsetBase = util.getAbsolutePosition.offsetBase = document.createElement('div'); offsetBase.style.cssText = 'position:absolute;left:0;top:0'; document.body.appendChild(offsetBase); } if (el && el.ownerDocument === document && 'getBoundingClientRect' in el && offsetBase) { var boundingRect = el.getBoundingClientRect(); var baseRect = offsetBase.getBoundingClientRect(); found = true; left = boundingRect.left - baseRect.left; top = boundingRect.top - baseRect.top; width = boundingRect.right - boundingRect.left; height = boundingRect.bottom - boundingRect.top; } return { found: found, left: left, top: top, width: width, height: height, right: left + width, bottom: top + height }; } function App_setElementPositionToWindowCenter($dialog) { $dialog.position({ my:"center", at:"center", of: window }); } function App_scrollToBottom($element) { $element.scrollTop($element.prop("scrollHeight")); } function App_scrollToTop($element) { $element.scrollTop(0); } function App_scrollToPosX($element, posX, isAnim) { if(isAnim != null && isAnim == true) { $element.animate({ scrollLeft:posX }, 200); } else { $element.scrollLeft(posX); } } function App_scrollToPosY($element, posY, isAnim) { if(isAnim != null && isAnim == true) { $element.animate({ scrollTop:posY }, 200); } else { $element.scrollTop(posY); } } function App_willScrollToDocumentEnd(action) { $(document).scroll(function() { if ($(document).height() - window.innerHeight <= ($(window).scrollTop() + 10)) { if(action != null) { action(); } } }); } function App_checkIsAboutToScrollToDocumentEnd() { return ($(document).height() - window.innerHeight <= ($(window).scrollTop() + 10)); } function App_parallaxScroll($element) { $(document).scroll(function() { var $elementParentElement = $element.parent(); if($elementParentElement != null && $elementParentElement.css("position") == "fixed") { return; } var transformValue = "translateY(" + ($(window).scrollTop() / 2) + "px)"; if($element.css("-webkit-transform") != null) { $element.css("-webkit-transform", transformValue); } else if($element.css("-moz-transform") != null) { $element.css("-moz-transform", transformValue); } else if($element.css("-ms-transform") != null) { $element.css("-ms-transform", transformValue); } else { $element.css("transform", transformValue); } }); } function App_showLessElementContent($element) { var readmoreOption = { moreLink: 'read moreeeeeee', lessLink: 'read lesssssssssss', blockCSS: ('padding-left:' + $element.css("padding-left") + ';') }; $element.readmore(readmoreOption); } function App_titleAlert(message) { $.titleAlert(message, {stopOnMouseMove:true}); } function App_appendAppOverlay() { if($("#App_overlay") != null) { $("#App_overlay").remove(); } var $overlayElement = $('
'); $("body").append($overlayElement); return $overlayElement; } function App_removeAppOverlay() { $("#App_overlay").remove(); } function App_showDialog(options) { if(options.autoSize == null) { options.autoSize = false; } if(options.hasClose == null) { options.hasClose = true; } if(options.hasMask == null) { options.hasMask = true; } return $("
").dialogBox(options); } function App_relocateDialog($dialog) { $dialog.css({ 'margin-top': function(){ var height; if(type === '' || type === 'normal'){ if(that.settings.autoSize){ height = $(this).height(); }else{ height = that.settings.height; } }else if(type === 'error' || type === 'correct'){ if(that.settings.autoSize){ height = $(this).height(); }else{ height = that.settings.height + 4; } } return -Math.round(height/2) + 'px'; }, 'margin-left': function(){ var width = $(this).width(); return -Math.round(width/2) + 'px'; } }); } /* function App_appendTooltip($targetElement, message, position) { if(position == null) { position = "top"; } $targetElement.bootstrap_tooltip( { title:message, html:true, placement:position }); } */ function App_insertAnimatedDropdownBackdropAfterRelatedTarget($relatedTarget) { App_hideAllTooltip(); $('.dropdown-backdrop').remove(); $(".dropdown-menu").removeClass('fade').removeClass('in'); var $dropdownBackdrop = $(document.createElement('div')) .addClass('dropdown-backdrop') .insertAfter($relatedTarget) .on('click', function() { $(this).parent().find(".dropdown-menu").removeClass('fade').removeClass('in'); $(this).remove(); }); $relatedTarget.parent().find(".dropdown-menu").addClass('fade'); setTimeout(function() { $relatedTarget.parent().find(".dropdown-menu").addClass('in'); }, 10); } function App_dynamicTabs($element, menuMap, afterAddTabEvent) { var html = '
' + '' + '
' + '
'; $element.append(html); $element.prop("afterAddTabEvent", function() { return (function(arg) { afterAddTabEvent(arg); }); }); var menuMapKeys = Object.keys(menuMap); if(menuMapKeys.length > 0) { for(var menuMapKeysIndex = 0; menuMapKeysIndex < menuMapKeys.length; ++menuMapKeysIndex) { var menuMapKey = menuMapKeys[menuMapKeysIndex]; if($element.find('.tab-content:first .tab-pane[code="' + menuMapKey + '"]').length == 0) { var $dropdownMenuItem = $('
  • ' + menuMap[menuMapKey] + '
  • '); $element.find(".dropdown-menu:first").append($dropdownMenuItem); $dropdownMenuItem.find("a").click(function() { App_dynamicTabsAddTab($element, $(this).parent().attr("code"), $(this).html()); }); } } { var firstMenuMapKey = menuMapKeys[0]; App_dynamicTabsAddTab($element, firstMenuMapKey, menuMap[firstMenuMapKey]); } } } function App_dynamicTabsAddTab($tabs, code, label) { if($tabs.find('.tab-content:first .tab-pane[code="' + code + '"]').length > 0) { return; } var $tabPane = $('
    '); $tabs.find('.tab-content:first').append($tabPane); $tabs.prop("afterAddTabEvent")($tabPane); var tabCount = $tabs.find('.nav-tabs:first li').length; var navTabHtml = '
  • ' + '' + label + ((tabCount == 1) ? (' (' + "Default" + ')') : ' ') + '' + '
  • '; var $navTab = $(navTabHtml); $navTab.insertBefore($tabs.find('.nav-tabs:first .dropdown')); $navTab.find(".glyphicon-remove").click(function() { App_dynamicTabsRemoveTab($tabs, code); }); $tabs.find('.dropdown-menu:first li[code="' + code + '"]:first').hide(); App_dynamicTabsFocusTab($tabs, code); } function App_dynamicTabsRemoveTab($tabs, code) { $tabs.find('.tab-content:first .tab-pane[code="' + code + '"]:first').remove(); $tabs.find('.nav-tabs:first li[code="' + code + '"]:first').remove(); $tabs.find('.dropdown-menu:first li[code="' + code + '"]:first').show(); App_dynamicTabsFocusFirstTab($tabs); } function App_dynamicTabsFocusTab($tabs, code) { $tabs.find(".nav-tabs:first li").removeClass('active'); $tabs.find(".tab-content:first .tab-pane").removeClass('active'); $tabs.find('.tab-content:first .tab-pane[code="' + code + '"]:first').addClass("active in"); $tabs.find('.nav-tabs:first li[code="' + code + '"]:first').addClass("active"); } function App_dynamicTabsFocusFirstTab($tabs) { App_dynamicTabsFocusTab($tabs, $tabs.find('.nav-tabs:first li:first').attr("code")); } function App_dynamicTabsGetTabPaneByCode($tabs, code) { return $tabs.find('.tab-content:first .tab-pane[code="' + code + '"]:first'); } function App_dynamicTabsGetTabPanes($tabs) { return $tabs.find('.tab-content:first .tab-pane'); } function App_dynamicTabsHideDropdown($element) { $element.find(".dropdown").hide(); } function App_dynamicTabsShowDropdown($element) { $element.find(".dropdown").show(); } function App_elementLoadingStart($element) { $element = $("body"); if(!$element.is(':loading')) { $element.loading({"message": "Loading..."}); } } function App_elementLoadingStop($element) { $element = $("body"); $element.loading("stop"); } function App_localeTabs($element, afterAddTabEvent) { var menuMap = new Array(); var App_localeMapKeys = Object.keys(App_localeMap); for(var localeMapKeysIndex = 0; localeMapKeysIndex < App_localeMapKeys.length; ++localeMapKeysIndex) { var App_localeMapKey = App_localeMapKeys[localeMapKeysIndex]; menuMap[App_localeMapKey] = App_localeMap[App_localeMapKey].description; } App_dynamicTabs($element, menuMap, afterAddTabEvent); var $enNavTabHyperLink = $element.find('.nav-tabs:first li[code="' + "en" + '"]:first a[data-toggle="tab"]:first'); $enNavTabHyperLink.find('.glyphicon-remove').remove(); $enNavTabHyperLink.append(' '); } function App_localeTabsAddLocaleTab($tabs, localeCode) { App_dynamicTabsAddTab($tabs, localeCode, App_localeMap[localeCode].description); } function App_localeTabsRemoveLocaleTab($tabs, localeCode) { App_dynamicTabsRemoveTab($tabs, localeCode); } function App_localeTabsFocusLocaleTab($tabs, localeCode) { App_dynamicTabsFocusTab($tabs, localeCode); } function App_localeTabsFocusFirstLocaleTab($tabs) { App_dynamicTabsFocusFirstTab($tabs); } function App_localeTabsSelectLocaleTabPaneByLocaleCode($tabs, localeCode) { return App_dynamicTabsGetTabPaneByCode($tabs, localeCode); } function App_localeTabsSelectLocaleTabPanes($tabs) { return App_dynamicTabsGetTabPanes($tabs); } function App_localeTabsHideLocaleDropdown($element) { App_dynamicTabsHideDropdown($element); } function App_localeTabsShowLocaleDropdown($element) { App_dynamicTabsShowDropdown($element); } function App_toastr(message, title, onShownAction, onHiddenAction, onclickAction) { var options = { "positionClass": "toast-bottom-center" }; if(onShownAction != null) { options.onShown = onShownAction; } if(onHiddenAction != null) { options.onHidden = onHiddenAction; } if(onclickAction != null) { options.onclick = onclickAction; } toastr.success(message, title, options); } function App_horizontalTabs($element, isRecordHistory) { if(isRecordHistory == null) { isRecordHistory = true; } $element.hide(); $element.pwstabs({ theme:"pws_theme_cga", effect:"none", recordHistory:isRecordHistory }); /* var $horizontalTabElement = $element.parent(); if($horizontalTabElement != null) { var horizontalTabElementWidth = $horizontalTabElement.width(); $horizontalTabElement.find(".pws_tabs_controll").css("width", "200px"); $horizontalTabElement.find(".pws_tabs_list").css("width", ((horizontalTabElementWidth - 200 - 1) + "px"));//reduce border width "1" from theme "pws_theme_cga" } */ $element.show(); } function App_horizontalTabsFocusTab($element, tabCode) { $element.parent().find('ul.pws_tabs_controll li a').removeClass("pws_tab_active"); App_horizontalTabsGetTab($element, tabCode).addClass("pws_tab_active"); $element.find(".pws_tab_single").removeClass("pws_show"); $element.find(".pws_tab_single").hide(); $element.find('.pws_tab_single[data-pws-tab="' + tabCode + '"]').addClass("pws_show"); $element.find('.pws_tab_single[data-pws-tab="' + tabCode + '"]').show(); App_horizontalTabsGetTab($element, tabCode).click(); } function App_horizontalTabsGetTab($element, tabCode) { return $element.parent().find('ul.pws_tabs_controll li a[data-tab-id="' + tabCode + '"]'); } function App_horizontalTabsHideTab($element, tabCode) { App_horizontalTabsGetTab($element, tabCode).removeClass("pws_tab_active"); App_horizontalTabsGetTab($element, tabCode).hide(); if($element.find('.pws_tab_single[data-pws-tab="' + tabCode + '"]').hasClass("pws_show")) { $element.find('.pws_tab_single[data-pws-tab="' + tabCode + '"]').removeClass("pws_show"); $element.find('.pws_tab_single[data-pws-tab="' + tabCode + '"]').hide(); $element.parent().find('ul.pws_tabs_controll li a:visible').click(); } } function App_horizontalTabsShowTab($element, tabCode) { App_horizontalTabsGetTab($element, tabCode).show(); if($element.find(".pws_tab_single.pws_show").length == 0) { App_horizontalTabsGetTab($element, tabCode).click(); } } function App_horizontalTabsOverflow($element) { var $horizontalTabElement = $element.parent(); var $horizontalTabControlElement = $horizontalTabElement.find("ul.pws_tabs_controll:first"); $horizontalTabControlElement.css("max-width", "100%"); $horizontalTabControlElement.css("overflow-x", "auto"); $horizontalTabControlElement.css("white-space", "nowrap"); var scrollToPosX = 0; $horizontalTabControlElement.children("li").each(function() { if($(this).children("a").hasClass("pws_tab_active")) { scrollToPosX -= (App_getScreenWidth() - $(this).width()) / 2; scrollToPosX = Math.max(scrollToPosX, 0); return false;//break; } scrollToPosX += $(this).width(); }); App_scrollToPosX($horizontalTabControlElement, scrollToPosX, false); $horizontalTabElement.css("position", "relative"); if($horizontalTabControlElement.prop("scrollWidth") > Math.max($horizontalTabControlElement.width(), 0)) { var $scrollLeftButton = $('
    ๎Œ”
    '); $scrollLeftButton.on("click", function() { App_scrollToPosX($horizontalTabControlElement, ($horizontalTabControlElement.scrollLeft() - Math.max(($horizontalTabElement.width() / 2), 100)), true); }); $horizontalTabElement.append($scrollLeftButton); var $scrollRightButton = $('
    ๎Œ•
    '); $scrollRightButton.on("click", function() { App_scrollToPosX($horizontalTabControlElement, ($horizontalTabControlElement.scrollLeft() + Math.max(($horizontalTabElement.width() / 2), 100)), true); }); $horizontalTabElement.append($scrollRightButton); $horizontalTabControlElement.on("scroll", function() { if($horizontalTabControlElement.scrollLeft() == 0) { $scrollLeftButton.hide(); } else { $scrollLeftButton.show(); } if(($horizontalTabControlElement.scrollLeft() + $horizontalTabElement.width()) == $horizontalTabControlElement.prop("scrollWidth")) { $scrollRightButton.hide(); } else { $scrollRightButton.show(); } }); } } function App_horizontalTabsResponsiveFlexTabs($element) { var $horizontalTabElement = $element.parent(); var $horizontalTabControlElement = $horizontalTabElement.find("ul.pws_tabs_controll:first"); $horizontalTabControlElement.children("li").css("min-width", ""); $horizontalTabControlElement.children("li").css("width", ""); var tabWidthArray = new Array(); var tabWidthTotal = 0; var visibleTabCount = 0; $horizontalTabControlElement.children("li").each(function() { var tabWidth = $(this).width(); $(this).css("min-width", tabWidth); tabWidthArray.push(tabWidth); tabWidthTotal += tabWidth; if(tabWidth > 0) { ++visibleTabCount; } }); var horizontalTabControlElementReservedWidth = $horizontalTabControlElement.width() - tabWidthTotal; if(horizontalTabControlElementReservedWidth > 0) { var tabIncreaseWidth = Math.floor(horizontalTabControlElementReservedWidth / visibleTabCount); for(var i = 0; i < tabWidthArray.length; ++i) { var tabWidth = tabWidthArray[i]; if(tabWidth <= 0) { continue; } $horizontalTabControlElement.children("li:eq(" + i + ")").css("width", (tabWidth + tabIncreaseWidth)); } } } function App_verticalTabs($element, isRecordHistory) { if(isRecordHistory == null) { isRecordHistory = true; } $element.hide(); $element.pwstabs({ theme:"pws_theme_cga", effect:"none", tabsPosition:"vertical", recordHistory:isRecordHistory }); var $verticalTabElement = $element.parent(); if($verticalTabElement != null) { var verticalTabElementWidth = $verticalTabElement.width(); $verticalTabElement.find(".pws_tabs_controll").css("width", "200px"); $verticalTabElement.find(".pws_tabs_list").css("width", ((verticalTabElementWidth - 200 - 1) + "px"));//reduce border width "1" from theme "pws_theme_cga" } $element.show(); } function App_verticalTabsFocusTab($element, tabCode) { App_horizontalTabsFocusTab($element, tabCode); } function App_horizontalTabs2($element, isRecordHistory) { if(isRecordHistory == null) { isRecordHistory = true; } $element.hide(); $element.pwstabs({ theme:"pws_theme_cga2", effect:"none", recordHistory:isRecordHistory }); /* var $horizontalTabElement = $element.parent(); if($horizontalTabElement != null) { var horizontalTabElementWidth = $horizontalTabElement.width(); $horizontalTabElement.find(".pws_tabs_controll").css("width", "200px"); $horizontalTabElement.find(".pws_tabs_list").css("width", ((horizontalTabElementWidth - 200 - 1) + "px"));//reduce border width "1" from theme "pws_theme_cga" } */ $element.show(); } function App_horizontalTabs2FocusTab($element, tabCode) { App_horizontalTabsFocusTab($element, tabCode); } function App_horizontalTabs3($element, isRecordHistory) { if(isRecordHistory == null) { isRecordHistory = true; } $element.hide(); $element.pwstabs({ theme:"pws_theme_cga3", effect:"none", recordHistory:isRecordHistory }); /* var $horizontalTabElement = $element.parent(); if($horizontalTabElement != null) { var horizontalTabElementWidth = $horizontalTabElement.width(); $horizontalTabElement.find(".pws_tabs_controll").css("width", "200px"); $horizontalTabElement.find(".pws_tabs_list").css("width", ((horizontalTabElementWidth - 200 - 1) + "px"));//reduce border width "1" from theme "pws_theme_cga" } */ $element.show(); } function App_horizontalTabs3FocusTab($element, tabCode) { App_horizontalTabsFocusTab($element, tabCode); } function App_getSessionId() { return null; } function App_generateElementId() { return "id_" + new Date().getTime() + "_" + Math.floor(Math.random() * 10000000000); } function App_generateAutocompleteCellContentHtml(iconUrl, title, content) { var html = '' + ''; if(iconUrl != null) { html += '' + ''; } html += '' + '' + '
     ' + '
    ' + (!System_checkIsEmptyString(title)?title:"") + '
    ' + '
    ' + (!System_checkIsEmptyString(content)?content:"") + '
    ' + '
    '; return html; } function App_generateIconAndTitleAndContentCellHtml(iconUrl, title, content, expand, iconClass, titleClass, contentClass, expandClass, iconRedirectUrl, titleRedirectUrl, contentRedirectUrl) { var html = '
    '; if(!System_checkIsEmptyString(iconUrl)) { html += '
    '; if(!System_checkIsEmptyString(iconRedirectUrl)) { html += ''; } html += ''; if(!System_checkIsEmptyString(iconRedirectUrl)) { html += ''; } html += '
    ' + '
     
    '; } if(!System_checkIsEmptyString(title) || !System_checkIsEmptyString(content)) { html += '
    '; if(!System_checkIsEmptyString(title)) { if(!System_checkIsEmptyString(titleRedirectUrl)) { html += ''; } html += '' + (!System_checkIsEmptyString(title) ? title : "") + ''; if(!System_checkIsEmptyString(titleRedirectUrl)) { html += ''; } } if(!System_checkIsEmptyString(content)) { if(!System_checkIsEmptyString(title)) { html += '
    '; } if(!System_checkIsEmptyString(contentRedirectUrl)) { html += ''; } html += '' + (!System_checkIsEmptyString(content) ? content : "") + ''; if(!System_checkIsEmptyString(contentRedirectUrl)) { html += ''; } } html += '
    '; } if(!System_checkIsEmptyString(expand)) { html += '
     
    ' + '
    ' + expand + '
    '; } html += '
    '; return html; } function App_createCarousel($parent, itemHtmls, isShownIndicator, isLoop, isAutoScroll) { if(isShownIndicator == null) { isShownIndicator = false; } if(isLoop == null) { isLoop = true; } if(isAutoScroll == null) { isAutoScroll = true; } var carouselId = App_generateElementId(); var html = ''; $carousel = $(html); $parent.append($carousel); var carouselConfig = {"wrap": isLoop}; if(!isAutoScroll) { carouselConfig.interval = false; } $carousel.carousel(carouselConfig); return $carousel; } function App_gotoCarouselItem($carousel, number) { $carousel.carousel(number); } function App_tooltip($targetElement, title, placement) { if($targetElement.attr("title") == null) { $targetElement.attr("title", ""); } $targetElement.tooltip({ container:"body", title:title, html:true, placement:placement }); } function App_tooltip2($targetElement, title) { $targetElement.uitooltip({ content: function() { return title; } }); } function App_hideTooltip($targetElement) { $targetElement.tooltip("hide"); } function App_hideAllTooltip() { $(".tooltip").tooltip("hide"); } function App_changeLocale(localeCode, action) { $.ajax({ url: "https://vs.cga.gg/api/user/set_locale", type: "POST", dataType: "json", data: { "locale":localeCode }, complete: function () { if(action != null) { action(); } else { location.reload(); } } }); } function App_logout(afterLogoutUrl) { App_endLoop(); } function App_Advertisement_generateAdvertisementHtml(advertisementType, advertisementWidth, advertisementHeight, isFillWith3rdAdvertisement) { var elementId = App_generateElementId(); var html = '
    ' + '