기본 팝업창 스타일 수정. (#1075)

# 기본 팝업창 스타일 수정.

- 바뀐 관리자 페이지 스타일과 통일성 유지.
 - 임시 저장 글 불러오는 팝업 창 스타일 조정
- 팝업창 크기 계산 함수 조정
 - 폭을 먼저 확정한 다음 높이를 계산하도록 순서 조정
 - 위젯 수정 페이지 팝업 창 크기 계산 수정
 - 창 너비를 자유롭게 바꿀 수 있기 때문에, `.popup` 클래스를 가진 객체의 가로 폭을 자바스크립트가 강제로 변경하지 않도록 수정. (초기 가로 폭은 정확히 계산하여서 기존과 동일하게 맞춤)
- 라이믹스 문법에 맞춤
 - `jQuery` 를 `$` 로 쓸 수 있으므로 생략 가능한 구문 수정
This commit is contained in:
Min-Soo Kim 2018-08-19 16:50:00 +09:00 committed by GitHub
parent bf6e90d98b
commit a16670c6f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 129 additions and 116 deletions

View file

@ -1,16 +1,22 @@
<load target="popup.js" />
<load target="popup.css" />
{@Context::addMetaTag('viewport', 'width=device-width', FALSE);}
<section class="section">
<div class="x_modal-header">
<h1>{$component_info->title}</h1>
<div class="x_clearfix">
<div class="x_pull-right">
<select name="list" id="selectEmoticonList">
<!--@foreach($emoticon_list as $key => $val)-->
<option <!--@if($val=='msn')-->selected="select"<!--@end--> value="{$val}">{$val}</option>
<!--@end-->
</select>
</div>
</div>
<div class="x_modal-body">
<div>
<select name="list" id="selectEmoticonList">
<!--@foreach($emoticon_list as $key => $val)-->
<option <!--@if($val=='msn')-->selected="select"<!--@end--> value="{$val}">{$val}</option>
<!--@end-->
</select>
</div>
<div id="emoticons" style="min-height:1px"></div>
</section>
<div class="x_clearfix btnArea">
<div class="x_pull-right">
<button type="button" class="x_btn x_btn-primary" onclick="insertSlideShow()">{$lang->cmd_insert}</button>
<a class="x_btn" href="{getUrl('','module','editor','act','dispEditorComponentInfo','component_name',$component_info->component_name)}" target="_blank" onclick="window.open(this.href,'ComponentInfo','width=10,height=10');return false;">{$lang->about_component}</a>
</div>
</div>
</div>

View file

@ -1,5 +1,3 @@
jQuery(function($){
var is_popup = window._isPoped;
/**
@ -17,25 +15,12 @@ function getEmoticons(emoName) {
* @brief Load callback
*/
function completeGetEmoticons(ret_obj) {
var emoticons = ret_obj['emoticons'].split("\n");
var html = [];
for(var i=0;i<emoticons.length;i++) {
html[html.length] = '<img src="./modules/editor/components/emoticon/tpl/images/'+emoticons[i]+'" class="emoticon" />';
}
jQuery('#emoticons').html(html.join('')).find('img.emoticon')
.click(insertEmoticon)
.load(function(){
/* resize popup window for new emoticons loaded, 2015-07-14 by misol */
if(jQuery('section.section').outerHeight(true) != jQuery( window ).height())
{
// more space for y-scroll
var ww = (jQuery('section.section').outerHeight(true) > jQuery( window ).height())? jQuery('section.section').outerWidth(true) + 60 : jQuery('section.section').outerWidth(true) + 30;
// not more than screen height
var wh = (screen.height-100 < jQuery('section.section').outerHeight(true)+100)? screen.height-100 : jQuery('section.section').outerHeight(true)+100;
window.resizeTo(ww, wh);
}
});
var emoticons = ret_obj.emoticons.item;
var html = [];
for(var i=0;i<emoticons.length;i++) {
html[html.length] = '<img src="./modules/editor/components/emoticon/tpl/images/'+emoticons[i].filename+'" width="' + parseInt(emoticons[i].width, 10) + '" height="' + parseInt(emoticons[i].height, 10) + '" onclick="insertEmoticon()" onload="setFixedPopupSize()" class="emoticon" />';
}
$('#emoticons').html(html.join(''));
}
/**
@ -47,7 +32,7 @@ function insertEmoticon() {
if(!win) return;
html = '<img src="'+this.src+'" class="emoticon" />';
html = '<img src="'+this.src+'" width="'+this.width+'" height="'+this.height+'" class="emoticon" />';
win.editorFocus(win.editorPrevSrl);
win.editorRelKeys[win.editorPrevSrl].pasteHTML(html);
@ -57,8 +42,9 @@ function insertEmoticon() {
return false;
}
// load default emoticon set
getEmoticons('msn');
$('#selectEmoticonList').change(function(){ getEmoticons(this.value) });
$(function(){
// load default emoticon set
getEmoticons('msn');
$('#selectEmoticonList').change(function(){ getEmoticons(this.value) });
});