From 0d152fafc7ed9f7cede2569d6d608fd94864d989 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 21 Sep 2018 02:06:45 +0900 Subject: [PATCH] =?UTF-8?q?=ED=88=B4=ED=8C=81=20class=20=EC=88=98=EC=A0=95?= =?UTF-8?q?.=20=EC=A7=80=EB=8F=84=EC=9D=98=20=EB=85=84=EC=9B=94=EC=97=90?= =?UTF-8?q?=20=EC=98=AC=EB=A6=AC=EB=A9=B4=20=EC=B4=88=EB=B0=98=20=EC=A0=9C?= =?UTF-8?q?=ED=95=9C,=20=EA=B8=B0=EC=88=A0=20=EC=A0=9C=ED=95=9C=20?= =?UTF-8?q?=ED=88=B4=ED=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/css/map.css | 6 ++++++ hwe/js/common.js | 23 ++++++++++++++++++----- hwe/js/map.js | 26 ++++++++++++++++++++++++++ hwe/templates/map.php | 5 +++-- 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/hwe/css/map.css b/hwe/css/map.css index e6fdc9ce..935458c6 100644 --- a/hwe/css/map.css +++ b/hwe/css/map.css @@ -11,6 +11,12 @@ text-align:center; } +.map_title_tooltiptext .tooltip-inner{ + max-width:220px; + width:220px; + text-align: left; +} + .map_title_text{ margin:auto; text-align:center; diff --git a/hwe/js/common.js b/hwe/js/common.js index bedfba52..782b9de9 100644 --- a/hwe/js/common.js +++ b/hwe/js/common.js @@ -144,11 +144,24 @@ function getIconPath(imgsvr, picture){ } jQuery(function($){ - $('.obj_tooltip').tooltip({ - title:function(){ - return $.trim($(this).find('.tooltiptext').html()); - }, - html:true + $('.obj_tooltip').each(function(){ + var $objTooltip = $(this); + var tooltipClassText = $objTooltip.data('tooltip-class'); + if(!tooltipClassText){ + tooltipClassText = ''; + } + console.log($objTooltip.data('tooltip-class')); + var template = '' + .format(tooltipClassText); + + $objTooltip.tooltip({ + title:function(){ + return $.trim($(this).find('.tooltiptext').html()); + }, + template:template, + html:true + }); + }); var customCSS = localStorage.getItem('sam_customCSS'); diff --git a/hwe/js/map.js b/hwe/js/map.js index 1e15b552..e649b9af 100644 --- a/hwe/js/map.js +++ b/hwe/js/map.js @@ -90,6 +90,32 @@ function reloadWorldMap(option){ $map_title.css('color', 'yellow'); } + $map_title_tooltip = $('.map_title .tooltiptext'); + $map_title_tooltip.empty(); + + var tooltipTexts = []; + if(year < startYear + 3){ + var startYearText = []; + var remainYear = startYear + 3 - year; + var remainMonth = 12 - month + 1; + if(remainMonth > 0){ + remainYear -= 1; + } + if(remainYear){ + startYearText.push('{0}년'.format(remainYear)); + } + if(remainMonth){ + startYearText.push('{0}개월'.format(remainMonth)); + } + + tooltipTexts.push('초반 제한까지 : {0} ({1}년)'.format(startYearText.join(' '), startYear + 3)); + } + + var currentTechLimit = Math.floor(Math.max(0, year - startYear) / 5) + 1; + var nextTechLimitYear = currentTechLimit * 5 + startYear; + + tooltipTexts.push('기술등급 제한 : {0}등급 ({1}년 해제)'.format(currentTechLimit, nextTechLimitYear, currentTechLimit+1)); + $map_title_tooltip.html(tooltipTexts.join('
')); $world_map.removeClass('map_string map_summer map_fall map_winter'); if(month <= 3){ diff --git a/hwe/templates/map.php b/hwe/templates/map.php index 12c2527c..72b97147 100644 --- a/hwe/templates/map.php +++ b/hwe/templates/map.php @@ -1,7 +1,8 @@
-
- +
+ +