From d49803baed4793a828d15e4e034b939bc5ba37d8 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 11 Feb 2018 00:13:11 +0900 Subject: [PATCH] =?UTF-8?q?String.prototype.format=EC=9D=84=20common.js?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/js/common.js | 12 ++++++++++++ twe/js/map.js | 7 ------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/twe/js/common.js b/twe/js/common.js index 27b486bf..142575e0 100644 --- a/twe/js/common.js +++ b/twe/js/common.js @@ -50,6 +50,18 @@ function convertSet(arr) { return result; } + +/** + * {0}, {1}, {2}형태로 포맷해주는 함수 +*/ +String.prototype.format = function() { + var args = arguments; + return this.replace(/{(\d+)}/g, function(match, number) { + return (typeof args[number] != 'undefined') ? args[number] : match; + }); +}; + + /** * 게임내에서 지원하는 color type만 선택할 수 있도록 해주는 함수 * @param {string} color #AAAAAA 또는 AAAAAA 형태로 작성된 RGB hex color string diff --git a/twe/js/map.js b/twe/js/map.js index d87b77f2..67f074dc 100644 --- a/twe/js/map.js +++ b/twe/js/map.js @@ -1,11 +1,4 @@ -String.prototype.format = function() { - var args = arguments; - return this.replace(/{(\d+)}/g, function(match, number) { - return (typeof args[number] != 'undefined') ? args[number] : match; - }); -}; - function reloadWorldMap(option){