diff --git a/css/config.css b/css/config.css index aa3cdf0f..f5b02819 100644 --- a/css/config.css +++ b/css/config.css @@ -164,4 +164,8 @@ a.samButton.disabled { .samCommandButton.disabled > .samButtonOuter > .samButtonInner::after{ content:'】' +} + +.tooltiptext { + display: none; } \ No newline at end of file diff --git a/hwe/j_server_basic_info.php b/hwe/j_server_basic_info.php index 40a89e5f..32913687 100644 --- a/hwe/j_server_basic_info.php +++ b/hwe/j_server_basic_info.php @@ -63,11 +63,13 @@ if(file_exists(__dir__.'/.htaccess')){ //TODO: 천통시에도 예약 오픈 알림이 필요..? -$admin = $gameStor->getValues(['isunited', 'npcmode', 'year', 'month', 'scenario', 'scenario_text', 'maxgeneral', 'turnterm']); +$admin = $gameStor->getValues(['isunited', 'npcmode', 'year', 'month', 'scenario', 'scenario_text', 'maxgeneral', 'turnterm', 'starttime', 'turntime']); $admin['maxUserCnt'] = $admin['maxgeneral']; $admin['npcMode'] = $admin['npcmode']; $admin['turnTerm'] = $admin['turnterm']; $admin['isUnited'] = $admin['isunited']; +$admin['starttime'] = substr($admin['starttime'], 5, 11); +$admin['turntime'] = substr($admin['turntime'], 5, 11); unset($admin['npcmode']); unset($admin['maxgeneral']); unset($admin['turnterm']); diff --git a/js/common.js b/js/common.js index 96602943..9e35ba19 100644 --- a/js/common.js +++ b/js/common.js @@ -141,4 +141,51 @@ function quickReject(errMsg){ var deferred = $.Deferred(); deferred.reject(errMsg); return deferred.promise(); -} \ No newline at end of file +} + +function initTooltip($obj){ + if($obj === undefined){ + $obj = $('.obj_tooltip'); + } + else if(!$obj.hasClass('obj_tooltip')){ + $obj = $obj.find('.obj_tooltip'); + } + console.log($obj); + + $obj.each(function(){ + $target = $(this); + + if($target.data('installHandler')){ + return true; + } + $target.data('installHandler', true); + + $target.mouseover(function(){ + var $objTooltip = $(this); + if($objTooltip.data('setObjTooltip')){ + return true; + } + + var tooltipClassText = $objTooltip.data('tooltip-class'); + if(!tooltipClassText){ + tooltipClassText = ''; + } + var template = '' + .format(tooltipClassText); + + $objTooltip.tooltip({ + title:function(){ + return $.trim($(this).find('.tooltiptext').html()); + }, + template:template, + html:true + }).tooltip('show'); + + $objTooltip.data('setObjTooltip', true); + }); + }); +} + +jQuery(function($){ + initTooltip(); +}); \ No newline at end of file diff --git a/js/entrance.js b/js/entrance.js index 7a369025..60651717 100644 --- a/js/entrance.js +++ b/js/entrance.js @@ -2,7 +2,7 @@ var serverListTemplate = "\ \ \ <%korName%>섭
\ - \ + \ \ - 폐 쇄 중 -\ \ @@ -96,12 +96,15 @@ function Entrance_drawServerList(serverInfos){ var game= result.game; //TODO: 서버 폐쇄 방식을 새롭게 변경 $serverHtml.find('.server_down').detach(); + var serverTime = '%s ~ %s'.format(game.startFrom) if(game.isUnited == 2){ $serverHtml.find('.n_country').html('§천하통일§'); + $serverHtml.find('.server_date').html('{0}
~ {1}'.format(game.starttime, game.turntime)); } else{ $serverHtml.find('.n_country').html('<{0}국 경쟁중>'.format(game.nationCnt)); + $serverHtml.find('.server_date').html('{0} ~'.format(game.starttime)); } $serverHtml.append( @@ -131,7 +134,7 @@ function Entrance_drawServerList(serverInfos){ ); } - + initTooltip($serverHtml); }); }); }