diff --git a/tmp_map/map.html b/tmp_map/map.html
index d4071195..37706b26 100644
--- a/tmp_map/map.html
+++ b/tmp_map/map.html
@@ -5,6 +5,7 @@
+
diff --git a/tmp_msg/msg.html b/tmp_msg/msg.html
index 961c2645..b3c1bb39 100644
--- a/tmp_msg/msg.html
+++ b/tmp_msg/msg.html
@@ -5,6 +5,7 @@
+
diff --git a/tmp_msg/msg.js b/tmp_msg/msg.js
index dac2d41c..9ea064cb 100644
--- a/tmp_msg/msg.js
+++ b/tmp_msg/msg.js
@@ -1,11 +1,66 @@
+
+
+//FIXME: ES6 template literal을 ES5에 맞게 변경
+var messageTemplate = `
+
+ bgcolor="#CC6600"
+ <%} else if(msgType == 'national') {%>
+ bgcolor="#336600"
+ <%} else /*$msgType == 'public'*/ {%>
+ bgcolor="#000055"
+ <%} %>
+ style="font-size:13px;table-layout:fixed;word-break:break-all;"
+ data-id="<%id%>"
+>
+
+
+ <%if(src.iconPath !== null) { %>
+
+ <%} else {%>
+ /*NOTE: image 폴더는 어느 단에서 다뤄야하는가? */
+ <%}%>
+
+
+ <%if(msgType == 'private') {%>
+ [
+ <%e(src.name)%>:<%e(src.nation)%>
+ ▶
+ <%e(dest.name)%>:<%e(dest.nation)%>
+ ]
+ <%} else if(msgType == 'national') {%>
+ [
+ <%e(src.name)%>:<%e(src.nation)%>
+ ▶
+ <%e(dest.nation)%>
+ ]
+ <%} else {%>
+ [
+ <%e(src.name)%>:<%e(src.nation)%>
+ ]
+ <%} %>
+ <<%e($datetime)%>>
+
+ <%e(message)%>
+
+
+
+`;
+
jQuery(function($){
var generalID=1;
var sequence =null;
-});
-
-
-function refreshMsg(){
+ function refreshMsg(){
-}
\ No newline at end of file
+ }
+
+ refreshMsg();
+});
\ No newline at end of file
diff --git a/tmp_msg/tmp_template.html b/tmp_msg/tmp_template.html
new file mode 100644
index 00000000..dded576a
--- /dev/null
+++ b/tmp_msg/tmp_template.html
@@ -0,0 +1,49 @@
+
+ bgcolor="#CC6600"
+ <%} else if(msgType == 'national') {%>
+ bgcolor="#336600"
+ <%} else /*$msgType == 'public'*/ {%>
+ bgcolor="#000055"
+ <%} %>
+ style="font-size:13px;table-layout:fixed;word-break:break-all;"
+ data-id="<%id%>"
+>
+
+
+ <%if(src.iconPath !== null) { %>
+
+ <%} else {%>
+ /*NOTE: image 폴더는 어느 단에서 다뤄야하는가? */
+ <%}%>
+
+
+ <%if(msgType == 'private') {%>
+ [
+ <%e(src.name)%>:<%e(src.nation)%>
+ ▶
+ <%e(dest.name)%>:<%e(dest.nation)%>
+ ]
+ <%} else if(msgType == 'national') {%>
+ [
+ <%e(src.name)%>:<%e(src.nation)%>
+ ▶
+ <%e(dest.nation)%>
+ ]
+ <%} else {%>
+ [
+ <%e(src.name)%>:<%e(src.nation)%>
+ ]
+ <%} %>
+ <<%e($datetime)%>>
+
+ <%e(message)%>
+
+
+
\ No newline at end of file
diff --git a/twe/a_status.php b/twe/a_status.php
index 71ef307e..cad3073a 100644
--- a/twe/a_status.php
+++ b/twe/a_status.php
@@ -25,6 +25,7 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
세력도
+
+
+
diff --git a/twe/js/base_map.js b/twe/js/base_map.js
index 3acfb72b..a7e1bc49 100644
--- a/twe/js/base_map.js
+++ b/twe/js/base_map.js
@@ -1,40 +1,4 @@
-function convertDictById(arr){
- var result = {};
- arr.forEach(function(v, i){
- result[v.id] = v;
- });
- return result;
-}
-function convertSet(arr){
- var result = {};
- arr.forEach(function(v){
- result[v] = v;
- });
- return result;
-}
-
-function convColorValue(color){
- if(color.charAt(0) == '#'){
- color = color.substr(1);
- }
- color = color.toUpperCase();
-
- var colorBase = convertSet([
- '000080', '0000FF', '008000', '008080', '00BFFF', '00FF00', '00FFFF', '20B2AA',
- '2E8B57', '483D8B', '6495ED', '7B68EE', '7CFC00', '7FFFD4', '800000', '800080',
- '808000', '87CEEB', 'A0522D', 'A9A9A9', 'AFEEEE', 'BA55D3', 'E0FFFF', 'F5F5DC',
- 'FF0000', 'FF00FF', 'FF6347', 'FFA500', 'FFC0CB', 'FFD700', 'FFDAB9', 'FFFF00',
- 'FFFFFF'
- ]);
-
- if(!colorBase.hasOwnProperty(color)){
- return '000000';
- }
-
- return color;
-
-}
function getCityPosition(){
return {
diff --git a/twe/js/common.js b/twe/js/common.js
new file mode 100644
index 00000000..27b486bf
--- /dev/null
+++ b/twe/js/common.js
@@ -0,0 +1,109 @@
+/**
+ * <>& 등을 html에서도 그대로 보이도록 escape주는 함수
+ * @see https://stackoverflow.com/questions/24816/escaping-html-strings-with-jquery
+ * @param {string} string escape하고자 하는 문자열
+ * @returns {string}
+*/
+var escapeHtml = (function (string) {
+ var entityMap = {
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ "'": ''',
+ '/': '/',
+ '`': '`',
+ '=': '='
+ };
+
+ return function(string) {
+ return String(string).replace(/[&<>"'`=\/]/g, function(s) {
+ return entityMap[s];
+ });
+ }
+})();
+
+
+/**
+ * object의 array를 id를 key로 삼는 object로 재 변환
+ * @param {Array.{id: Object}} arr id를 가진 object의 array
+ * @returns {Object}
+ */
+function convertDictById(arr) {
+ var result = {};
+ arr.forEach(function (v, i) {
+ result[v.id] = v;
+ });
+ return result;
+}
+
+/**
+ * array를 set 형태의 object로 변환
+ * @param {Array} arr 값을 가진 array
+ * @returns {Object}
+ */
+function convertSet(arr) {
+ var result = {};
+ arr.forEach(function (v) {
+ result[v] = true;
+ });
+ return result;
+}
+
+/**
+ * 게임내에서 지원하는 color type만 선택할 수 있도록 해주는 함수
+ * @param {string} color #AAAAAA 또는 AAAAAA 형태로 작성된 RGB hex color string
+ * @returns {string}
+ */
+function convColorValue(color) {
+ if (color.charAt(0) == '#') {
+ color = color.substr(1);
+ }
+ color = color.toUpperCase();
+
+ var colorBase = convertSet([
+ '000080', '0000FF', '008000', '008080', '00BFFF', '00FF00', '00FFFF', '20B2AA',
+ '2E8B57', '483D8B', '6495ED', '7B68EE', '7CFC00', '7FFFD4', '800000', '800080',
+ '808000', '87CEEB', 'A0522D', 'A9A9A9', 'AFEEEE', 'BA55D3', 'E0FFFF', 'F5F5DC',
+ 'FF0000', 'FF00FF', 'FF6347', 'FFA500', 'FFC0CB', 'FFD700', 'FFDAB9', 'FFFF00',
+ 'FFFFFF'
+ ]);
+
+ if (!colorBase.hasOwnProperty(color)) {
+ return '000000';
+ }
+
+ return color;
+
+}
+
+/**
+ * 단순한 Template 함수. <%변수명%>으로 template 가능
+ * @see https://github.com/krasimir/absurd/blob/master/lib/processors/html/helpers/TemplateEngine.js
+ * @param {string} html
+ * @param {object} options
+ * @returns {string}
+ */
+var TemplateEngine = function (html, options) {
+ var re = /<%(.+?)%>/g,
+ reExp = /(^( )?(var|if|for|else|switch|case|break|{|}|;))(.*)?/g,
+ code = 'with(obj) { var r=[];\n',
+ cursor = 0,
+ result,
+ match;
+ var add = function (line, js) {
+ js ? (code += line.match(reExp) ? line + '\n' : 'r.push(' + line + ');\n') :
+ (code += line != '' ? 'r.push("' + line.replace(/"/g, '\\"') + '");\n' : '');
+ return add;
+ }
+ options.e = escapeHtml;
+ while (match = re.exec(html)) {
+ add(html.slice(cursor, match.index))(match[1], true);
+ cursor = match.index + match[0].length;
+ }
+ add(html.substr(cursor, html.length - cursor));
+ code = (code + 'return r.join(""); }').replace(/[\r\t\n]/g, ' ');
+ try { result = new Function('obj', code).apply(options, [options]); }
+ catch (err) { console.error("'" + err.message + "'", " in \n\nCode:\n", code, "\n"); }
+ return result;
+}
\ No newline at end of file
diff --git a/twe/processing.php b/twe/processing.php
index 5978a30d..362eea3e 100644
--- a/twe/processing.php
+++ b/twe/processing.php
@@ -118,6 +118,7 @@ function starter($name, $type=0) {
+