Index: reference/jquery-plugins/select2-4.0.13/src/scss/theme/default/layout.scss =================================================================== diff -u -r9be577a5089112a6741fe05ba795bb424a960cf4 -r0ae9dbe5f589310d20ce79f5986b8339b819589f --- reference/jquery-plugins/select2-4.0.13/src/scss/theme/default/layout.scss (.../layout.scss) (revision 9be577a5089112a6741fe05ba795bb424a960cf4) +++ reference/jquery-plugins/select2-4.0.13/src/scss/theme/default/layout.scss (.../layout.scss) (revision 0ae9dbe5f589310d20ce79f5986b8339b819589f) @@ -52,68 +52,16 @@ var page = urlParams.get("page"); if (includeLayout(page)) { - var str = window.location.href; - if (str.indexOf("community") > 0) { - $.getScript("js/" + page + ".js", function () { - /* 로그인 인증 여부 체크 함수 */ - execDocReady(); - }); - } else if (str.indexOf("arms") > 0) { - $.getScript("js/" + page + ".js", function () { - /* 로그인 인증 여부 체크 함수 */ - execDocReady(); - }); - } else { - alert("who are you?"); - } + $.getScript("js/" + page + ".js", function () { + /* 로그인 인증 여부 체크 함수 */ + execDocReady(); + }); } } - //dwr_login("test","admin"); } //////////////////////////////////////////////////////////////////////////////////////// -// DWR -//////////////////////////////////////////////////////////////////////////////////////// -// document.write(''); -// document.write(''); -// document.write(''); - -const makeSaveChatHistory = () => { - const chat_history = []; - return (userId, username, message, time) => { - chat_history.push({ userId, username, message, time }); - console.log("chatHistory -> " + JSON.stringify(chat_history)); - return chat_history; - }; -}; - -const saveChatHistory = makeSaveChatHistory(); - -function dwr_callback(userId, username, message, time) { - const lastMessage = { userId, username, message, time }; - saveChatHistory(userId, username, message, time); - - $(".notifications").addClass("alert-created"); - const alertDiv = $('
').addClass('alert pull-right'); - const closeButton = $('').addClass('close').attr('data-dismiss', 'alert').text('×'); - const infoIcon = $('').addClass('fa fa-info-circle'); - alertDiv.append(closeButton, infoIcon, lastMessage.message); - $(".notifications .alert").remove(); - $(".notifications").append(alertDiv); -} - -function dwr_login(userId,username){ - dwr.engine.setActiveReverseAjax(true); - dwr.engine.setNotifyServerOnPageUnload(true); - dwr.engine.setErrorHandler(function () { - console.log("DWR Error"); - }); - Chat.login(userId,username); - -} - -//////////////////////////////////////////////////////////////////////////////////////// // include 레이아웃 html 파일을 로드하는 함수 //////////////////////////////////////////////////////////////////////////////////////// function includeLayout(page) { @@ -228,6 +176,7 @@ $(".account-picture").append(account_html); runScript(); + dwr_login(userName, userName); }, 401: function (json) { $(".loader").addClass("hide"); Index: arms/js/common/dwrChat.js =================================================================== diff -u --- arms/js/common/dwrChat.js (revision 0) +++ arms/js/common/dwrChat.js (revision 0ae9dbe5f589310d20ce79f5986b8339b819589f) @@ -0,0 +1,40 @@ +document.write(''); +document.write(''); +document.write(''); + +const makeSaveChatHistory = () => { + const chat_history = []; + return (userId, username, message, time) => { + chat_history.push({ userId, username, message, time }); + if (chat_history.length > 10) { + chat_history.shift(); // 첫 번째 요소 제거 (가장 오래된 메시지) + } + console.log("chatHistory -> " + JSON.stringify(chat_history)); + return chat_history; + }; +}; + +const saveChatHistory = makeSaveChatHistory(); + +function dwr_callback(userId, username, message, time) { + const lastMessage = { userId, username, message, time }; + saveChatHistory(userId, username, message, time); + + $(".notifications.pull-right").addClass("alert-created"); + const alertDiv = $('
').addClass('alert pull-right'); + const closeButton = $('').addClass('close').attr('data-dismiss', 'alert').text('×'); + const infoIcon = $('').addClass('fa fa-info-circle').css('margin-right', '5px'); + alertDiv.append(closeButton, infoIcon, lastMessage.message); + $(".notifications.pull-right .alert").remove(); + $(".notifications.pull-right").append(alertDiv); +} + +function dwr_login(userId,username){ + dwr.engine.setActiveReverseAjax(true); + dwr.engine.setNotifyServerOnPageUnload(true); + dwr.engine.setErrorHandler(function () { + console.log("DWR Error"); + }); + Chat.login(userId,username); + +} Index: arms/template.html =================================================================== diff -u -rf12cb3e4181244228f29cd178a9fd619ae02cc7a -r0ae9dbe5f589310d20ce79f5986b8339b819589f --- arms/template.html (.../template.html) (revision f12cb3e4181244228f29cd178a9fd619ae02cc7a) +++ arms/template.html (.../template.html) (revision 0ae9dbe5f589310d20ce79f5986b8339b819589f) @@ -159,6 +159,7 @@ + Index: reference/jquery-plugins/ckeditor4-4.22.1/skins/prestige/editor.css.map =================================================================== diff -u --- reference/jquery-plugins/ckeditor4-4.22.1/skins/prestige/editor.css.map (revision 0) +++ reference/jquery-plugins/ckeditor4-4.22.1/skins/prestige/editor.css.map (revision 0ae9dbe5f589310d20ce79f5986b8339b819589f) @@ -0,0 +1 @@ +{} \ No newline at end of file