From 18e663c529a5fea86df7f366ddb726b76f5d46f6 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 11 Feb 2018 05:30:34 +0900 Subject: [PATCH] =?UTF-8?q?=ED=85=9C=ED=94=8C=EB=A6=BF=20=EC=B6=9C?= =?UTF-8?q?=EB=A0=A5=20=EC=A4=80=EB=B9=84=20=ED=85=9C=ED=94=8C=EB=A6=BF?= =?UTF-8?q?=EC=97=90=20option=20=ED=99=95=EC=9D=B8=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=ED=98=84=EC=9E=AC=20=EC=88=98=EB=87=8C=20?= =?UTF-8?q?=EC=97=AC=EB=B6=80=EB=8F=84=20=EB=B0=98=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmp_msg/fresh_result.json | 1 + tmp_msg/msg.js | 50 +++++++++++++++++++++++++---- tmp_msg/tmp_template.html | 7 +++- tmp_msg/update_national_result.json | 1 + tmp_msg/update_private_result.json | 1 + tmp_msg/update_public_result.json | 1 + 6 files changed, 53 insertions(+), 8 deletions(-) diff --git a/tmp_msg/fresh_result.json b/tmp_msg/fresh_result.json index f686b55e..8a817221 100644 --- a/tmp_msg/fresh_result.json +++ b/tmp_msg/fresh_result.json @@ -3,6 +3,7 @@ "server":"d1af658a-f094-4303-9496-9a27a8180b0b", "sequence":1122, "generalID":11, + "isChief":true, "national":[ { "id":1009, diff --git a/tmp_msg/msg.js b/tmp_msg/msg.js index 58098c23..7b61c7ae 100644 --- a/tmp_msg/msg.js +++ b/tmp_msg/msg.js @@ -17,7 +17,7 @@ var messageTemplate = ` bgcolor="#000055" <%} %> style="font-size:13px;table-layout:fixed;word-break:break-all;" - data-id="<%id%>" + id="msg_<%id%>" > @@ -52,19 +52,55 @@ var messageTemplate = ` <<%e($datetime)%>>
<%e(message)%> + <%if(this.option){ console.log('HasOption!!'); %> +
+ +
+ <%} %> `; -jQuery(function($){ - - var generalID=1; +var refreshMsg = (function(){ + var generalID=null; + var isChief = false; var sequence =null; - - function refreshMsg(){ - } + return function(){ + + + var deferred = $.ajax({ + url: option.targetJson, + type: 'post', + dataType:'json', + contentType: 'application/json', + data: JSON.stringify({ + sequence:sequence + }) + }); + + function registerGlobal(obj){ + if(!obj.result){ + deferred.reject(); + return; + } + generalID = obj.generalID; + isChief = obj.isChief; + sequence = obj.sequence; + return obj; + } + + deferred + .then(registerGlobal); + + + + + }; +})(); + +jQuery(function($){ refreshMsg(); }); \ No newline at end of file diff --git a/tmp_msg/tmp_template.html b/tmp_msg/tmp_template.html index 0608ca6f..9f0c7864 100644 --- a/tmp_msg/tmp_template.html +++ b/tmp_msg/tmp_template.html @@ -13,7 +13,7 @@ bgcolor="#000055" <%} %> style="font-size:13px;table-layout:fixed;word-break:break-all;" - data-id="<%id%>" + id="msg_<%id%>" > @@ -48,6 +48,11 @@ <<%e($datetime)%>>
<%e(message)%> + <%if(this.option){ console.log('HasOption!!'); %> +
+ +
+ <%} %> \ No newline at end of file diff --git a/tmp_msg/update_national_result.json b/tmp_msg/update_national_result.json index 73120f11..beba7ad3 100644 --- a/tmp_msg/update_national_result.json +++ b/tmp_msg/update_national_result.json @@ -3,6 +3,7 @@ "server":"d1af658a-f094-4303-9496-9a27a8180b0b", "sequence":1357, "generalID":11, + "isChief":true, "national":[ ], diff --git a/tmp_msg/update_private_result.json b/tmp_msg/update_private_result.json index 5ab74fcd..dfc3bd12 100644 --- a/tmp_msg/update_private_result.json +++ b/tmp_msg/update_private_result.json @@ -3,6 +3,7 @@ "server":"d1af658a-f094-4303-9496-9a27a8180b0b", "sequence":1366, "generalID":11, + "isChief":true, "national":[ ], diff --git a/tmp_msg/update_public_result.json b/tmp_msg/update_public_result.json index 27a2b9ee..271679ee 100644 --- a/tmp_msg/update_public_result.json +++ b/tmp_msg/update_public_result.json @@ -3,6 +3,7 @@ "server":"d1af658a-f094-4303-9496-9a27a8180b0b", "sequence":1811, "generalID":11, + "isChief":false, "national":[ ],