customCSS 추가

장수 아이콘에 generalIcon 클래스 추가
This commit is contained in:
2018-08-31 20:25:10 +09:00
parent df69ebf90e
commit e78dc083e3
31 changed files with 136 additions and 22 deletions
+5
View File
@@ -150,4 +150,9 @@ jQuery(function($){
},
html:true
});
var customCSS = localStorage.getItem('sam_customCSS');
if(customCSS){
$('<style type="text/css">\n'+customCSS+'\n</style>').appendTo($('head'));
}
});
+1 -1
View File
@@ -402,7 +402,7 @@ function activateMessageForm(){
jQuery(function($){
//tmp_template.html은 추후 msg.js에 통합될 수 있음
var getTemplate = $.get('js/templates/message.html',function(obj){
var getTemplate = $.get('js/templates/message.html?3',function(obj){
messageTemplate = obj;
});
+34
View File
@@ -0,0 +1,34 @@
jQuery(function($){
var initCustomCSSForm = function(){
var lastTimeOut = null;
var $obj = $('#custom_css');
var key = 'sam_customCSS';
var text = localStorage.getItem(key);
if(text){
$obj.val(text);
console.log(text);
}
if($obj.on('change keyup paste', function(){
var newText = $obj.val();
if(text == newText){
return;
}
if(lastTimeOut){
clearTimeout(lastTimeOut);
}
$obj.css('background-color', '#222222');
lastTimeOut = setTimeout(function(){
text = $obj.val();
localStorage.setItem(key, text);
$obj.css('background-color', 'black');
}, 500);
}));
}
initCustomCSSForm();
});
+2 -2
View File
@@ -5,9 +5,9 @@
>
<div class="msg_icon">
<%if(src.icon){ %>
<img width='64' height='64' src="<%encodeURI(src.icon)%>">
<img class='generalIcon' width='64' height='64' src="<%encodeURI(src.icon)%>">
<%} else {%>
<img width='64' height='64' src="<%encodeURI(defaultIcon)%>">
<img class='generalIcon' width='64' height='64' src="<%encodeURI(defaultIcon)%>">
<%}%>
</div>
<div class="msg_body">