first
This commit is contained in:
14
modules/mediaset/themes/_desktop/bs4-default-link/README.md
Normal file
14
modules/mediaset/themes/_desktop/bs4-default-link/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
# 부트스트랩4 파일 업로드 테마
|
||||
|
||||
부트스트랩
|
||||
|
||||
## 주요기능
|
||||
- 사진,파일 업로드
|
||||
- 첨부물 메타정보 등록
|
||||
- 첨부목록 숨김처리
|
||||
- 대표이미지 지정
|
||||
|
||||
## 요구사항
|
||||
- `widgets/_default/attach` 위젯 필요
|
||||
- `/plugins/jquery-form/4.2.2/jquery.form.min.js` 플러그인 필요
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$d['theme']['hidden_photo'] = "0"; // 이미지 추가시 사진 숨김여부 기본값 (숨김=1/보임=0)
|
||||
$d['theme']['allowedTypes'] = ""; // 업로드 가능한 파일 확장자. (명시하지 않으면 파일 확장자 필터링하지 않음.)
|
||||
$d['theme']['multiple'] = "1"; // 멀티 업로드 (허용=1/비허용=0)
|
||||
?>
|
||||
153
modules/mediaset/themes/_desktop/bs4-default-link/footer.php
Normal file
153
modules/mediaset/themes/_desktop/bs4-default-link/footer.php
Normal file
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
// 모달 페이지 인클루드
|
||||
include $g['dir_attach_theme'].'/modals.php';
|
||||
|
||||
getImport('moment','moment','2.22.2','js');
|
||||
getImport('moment-duration-format','moment-duration-format','2.2.2','js');
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
$('[data-act="linkInsert"]').tooltip({
|
||||
trigger: 'hover',
|
||||
title : '본문삽입'
|
||||
});
|
||||
|
||||
var check_url = $('#check_url');
|
||||
|
||||
check_url.find(".btn").click(function(){
|
||||
var container = '#attach_link'
|
||||
var fieldset = check_url
|
||||
var textarea = check_url.find('textarea')
|
||||
var url = textarea.val()
|
||||
|
||||
if (!url) {
|
||||
textarea.focus()
|
||||
return false
|
||||
}
|
||||
|
||||
var link_url_parse = $('<a>', {href: url});
|
||||
|
||||
//네이버 블로그 URL의 실제 URL 변환
|
||||
if ((link_url_parse.prop('hostname')=='blog.naver.com' || link_url_parse.prop('hostname')=='m.blog.naver.com' ) && link_url_parse.prop('pathname')) {
|
||||
var nblog_path_arr = link_url_parse.prop('pathname').split("/");
|
||||
var nblog_id = nblog_path_arr[1];
|
||||
var nblog_pid = nblog_path_arr[2];
|
||||
if (nblog_pid) {
|
||||
var url = 'https://blog.naver.com/PostView.nhn?blogId='+nblog_id+'&logNo='+nblog_pid;
|
||||
} else {
|
||||
var url = 'https://blog.naver.com/PostList.nhn?blogId='+nblog_id;
|
||||
}
|
||||
}
|
||||
|
||||
fieldset.attr('disabled',true)
|
||||
|
||||
$.get('//embed.kimsq.com/oembed',{
|
||||
url: url
|
||||
}).done(function(response) {
|
||||
var type = response.type;
|
||||
var title = response.title;
|
||||
var description = response.description;
|
||||
var thumbnail_url = response.thumbnail_url;
|
||||
var author = response.author;
|
||||
var provider = response.provider_name;
|
||||
var url = response.url;
|
||||
var width = response.thumbnail_width;
|
||||
var height = response.thumbnail_height;
|
||||
var embed = response.html;
|
||||
check_url.find('[data-role="title"]').text(title);
|
||||
check_url.find('[data-role="description"]').text(description);
|
||||
check_url.find('[data-role="thumbnail"]').attr('src',thumbnail_url);
|
||||
check_url.find('[data-act="insert"]').attr('data-url',url).attr('data-title',title).attr('data-description',description).attr('data-thumbnail',thumbnail_url).attr('data-provider',provider);
|
||||
|
||||
// 포스트 글쓰기 페이지 저장버튼 출력
|
||||
$('[data-role="postsubmit"]').removeClass('d-none');
|
||||
$('[data-role="library"]').addClass('d-none');
|
||||
|
||||
if (type=='video') {
|
||||
|
||||
$.get('//embed.kimsq.com/iframely',{
|
||||
url: url
|
||||
}).done(function(response) {
|
||||
var duration = response.meta.duration;
|
||||
var _duration = moment.duration(duration, 's');
|
||||
var formatted_duration = _duration.format("h:*m:ss");
|
||||
|
||||
$.post(rooturl+'/?r='+raccount+'&m=mediaset&a=saveLink',{
|
||||
type : 9,
|
||||
title : title,
|
||||
theme : '_desktop/bs4-default-link',
|
||||
description : description,
|
||||
thumbnail_url : thumbnail_url,
|
||||
author: author,
|
||||
provider : provider,
|
||||
url : url,
|
||||
duration : duration?duration:'',
|
||||
time : duration?formatted_duration:'',
|
||||
width : width,
|
||||
height : height,
|
||||
embed : embed
|
||||
},function(response){
|
||||
var result=$.parseJSON(response);
|
||||
if(!result.error){
|
||||
$(container).find('[data-role="attach-preview-link"]').prepend(result.list);
|
||||
$.notify("추가 되었습니다.");
|
||||
$('[data-role="postsubmit"]').click(); // 포스트 저장
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
$.post(rooturl+'/?r='+raccount+'&m=mediaset&a=saveLink',{
|
||||
type : 8,
|
||||
title : title,
|
||||
theme : '_desktop/bs4-default-link',
|
||||
description : description,
|
||||
thumbnail_url : thumbnail_url,
|
||||
author: author,
|
||||
provider : provider,
|
||||
url : url,
|
||||
width : width,
|
||||
height : height,
|
||||
embed : embed
|
||||
},function(response){
|
||||
var result=$.parseJSON(response);
|
||||
if(!result.error){
|
||||
$(container).find('[data-role="attach-preview-link"]').prepend(result.list);
|
||||
$.notify("추가 되었습니다.");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}).fail(function() {
|
||||
alert( "URL을 확인해주세요." );
|
||||
}).always(function() {
|
||||
textarea.val('')
|
||||
fieldset.attr('disabled',false)
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click','[data-act="linkInsert"]',function(){
|
||||
var url = $(this).attr('data-url')
|
||||
|
||||
$(this).attr('data-original-title', '본문삽입 되었습니다.')
|
||||
$(this).tooltip('show');
|
||||
$(this).attr('data-original-title', '본문삽입')
|
||||
|
||||
var html = '<figure class="media"><oembed url="'+url+'"></oembed></figure>'
|
||||
|
||||
InserHTMLtoEditor(editor,html)
|
||||
} );
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
95
modules/mediaset/themes/_desktop/bs4-default-link/header.php
Normal file
95
modules/mediaset/themes/_desktop/bs4-default-link/header.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
// 위젯 설정값 세팅
|
||||
$parent_module=$d['attach']['parent_module']; // 첨부파일 사용하는 모듈
|
||||
$parent_data=$d['attach']['parent_data']; // 해당 포스트 데이타 (수정시 필요)
|
||||
$attach_module_theme=$d['attach']['theme']; // 첨부파일 테마
|
||||
$attach_mode=$d['attach']['mod']; // list, main...
|
||||
$attach_handler_file=$d['attach']['handler_file']; //파일첨부 실행 엘리먼트 button or 기타 엘리먼트 data-role="" 형태로 하는 것을 권고
|
||||
$attach_handler_photo=$d['attach']['handler_photo']; // 사진첨부 실행 엘리먼트 button or 기타 엘리먼트 data-role="" 형태로 하는 것을 권고
|
||||
$attach_handler_getModalList=$d['attach']['handler_getModalList']; // 첨부파일 리스트 호출 handler
|
||||
$attach_object_type=$d['attach']['object_type']; // 첨부 대상에 따른 분류 : photo, file, link, video....
|
||||
$editor_type=$d['attach']['editor_type']; // 에디터 타입 : html,markdown
|
||||
|
||||
require_once $g['dir_attach_theme'].'/main.func.php'; // 함수 인클루드
|
||||
require_once $g['dir_attach_theme'].'/_var.php'; // 테마변수 인클루드
|
||||
require_once $g['path_module'].'mediaset/var/var.php'; //모듈 공통변수 인클루드
|
||||
?>
|
||||
|
||||
|
||||
<script src="<?php echo $g['url_attach_theme']?>/js/fileuploader.js"></script>
|
||||
<script src="<?php echo $g['url_attach_theme']?>/main.js"></script>
|
||||
|
||||
<!-- nestable : https://github.com/dbushell/Nestable -->
|
||||
<?php getImport('nestable','jquery.nestable',false,'js') ?>
|
||||
|
||||
<style media="screen">
|
||||
|
||||
/**
|
||||
* Nestable
|
||||
*/
|
||||
.dd { }
|
||||
.dd-list { display: block; position: relative; list-style: none; }
|
||||
.dd-list .dd-list { }
|
||||
.dd-collapsed .dd-list { display: none; }
|
||||
.dd-item,
|
||||
.dd-empty,
|
||||
.dd-placeholder { }
|
||||
.dd-handle {
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom:0;
|
||||
cursor: pointer;
|
||||
width: 25px;
|
||||
text-indent: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
background-color: #eff3f6;
|
||||
background-image: linear-gradient(-180deg, #fafbfc 0%, #eff3f6 90%);
|
||||
background-repeat: repeat-x;
|
||||
background-position: -1px -1px;
|
||||
background-size: 110% 110%;
|
||||
border-right: 1px solid rgba(27,31,35,0.1);
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.dd-handle:hover {
|
||||
background-color: #e6ebf1;
|
||||
background-image: linear-gradient(-180deg, #f0f3f6 0%, #e6ebf1 90%);
|
||||
background-position: -.5em;
|
||||
}
|
||||
.dd-handle:before {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
margin-top: -7px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
text-indent: 0;
|
||||
color: #494949;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.dd-placeholder,
|
||||
.dd-empty { margin: 5px 0; padding: 0; min-height: 30px; background: #f2fbff; border: 1px dashed #b6bcbf; box-sizing: border-box; -moz-box-sizing: border-box; }
|
||||
.dd-empty { border: 1px dashed #bbb; min-height: 100px; background-color: #e5e5e5;
|
||||
background-image: -webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
||||
-webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
|
||||
background-image: -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
||||
-moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
|
||||
background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
||||
linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
|
||||
background-size: 60px 60px;
|
||||
background-position: 0 0, 30px 30px;
|
||||
}
|
||||
.dd-dragel { position: absolute; pointer-events: none; z-index: 9999; }
|
||||
.dd-dragel > .dd-item .dd-handle { margin-top: 0; }
|
||||
.dd-dragel .dd-handle {
|
||||
-webkit-box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
|
||||
box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
function getAttachPlatformList($parent_data,$mod,$type) {
|
||||
global $table;
|
||||
|
||||
$upload=$parent_data['upload'];
|
||||
$featured_img_uid=$parent_data['featured_img'];// 대표이미지 uid
|
||||
|
||||
$sql='fserver=3';
|
||||
$attach = getArrayString($upload);
|
||||
|
||||
$uid_q='(';
|
||||
foreach($attach['data'] as $uid)
|
||||
{
|
||||
$uid_q.='uid='.$uid.' or ';
|
||||
}
|
||||
|
||||
$uid_q=substr($uid_q,0,-4).')';
|
||||
$sql=$sql.' and '.$uid_q;
|
||||
$RCD=getDbArray($table['s_upload'],$sql,'*','gid','asc','',1);
|
||||
$html='';
|
||||
while($R=db_fetch_array($RCD)){
|
||||
$U=getUidData($table['s_upload'],$R['uid']);
|
||||
$html.=getAttachPlatform($U,$mod,$featured_img_uid);
|
||||
}
|
||||
return $html;
|
||||
|
||||
}
|
||||
|
||||
// 추출 함수 (낱개)
|
||||
function getAttachPlatform($R,$mod,$featured_img_uid) {
|
||||
global $g,$r;
|
||||
|
||||
$md_title=str_replace('|','-',$R['title']);
|
||||
$thumbnail_url_parse = parse_url($R['src']);
|
||||
$thumbnail_url_arr = explode('//',$R['src']);
|
||||
|
||||
if ($R['provider']=='Google Maps') {
|
||||
$thumbnail = $R['src'];
|
||||
} else if (strpos($R['src'], '?') !== false) {
|
||||
$thumbnail = '/_core/opensrc/timthumb/thumb.php?src='.$R['src'].'&w=50&h=50&s=1';
|
||||
} else {
|
||||
$thumbnail = '/thumb'.($thumbnail_url_parse['scheme']=='https'?'-ssl':'').'/50x50/u/'.$thumbnail_url_arr[1];
|
||||
}
|
||||
|
||||
$insert_text='<video class=mejs-player img-responsive img-fluid style=max-width:100% preload=none><source src=https://www.youtube.com/embed/'.$R['src'].' type=video/youtube></video>';
|
||||
$html='';
|
||||
$html.='
|
||||
<li class="list-group-item d-flex dd-item" data-id="'.$R['uid'].'" style="background-color: transparent">';
|
||||
|
||||
$html.='
|
||||
<div class="dd-handle fa fa-arrows" title="순서변경"></div>
|
||||
<div class="media ml-3 mr-auto align-items-center">
|
||||
<a href="'.$R['linkurl'].'" target="_blank" class="d-flex align-self-center mr-3 position-relative"><img class="border" src="'.$thumbnail.'" alt="" style="width:50px;height:50px"><span class="position-absolute'.($R['duration']?'':' d-none').'" style="bottom:5px;right:5px;"><i class="fa fa-play-circle text-white" style="font-size:20px;text-shadow: 2px 2px 2px gray;" aria-hidden="true"></i></span></a>
|
||||
<div class="media-body">';
|
||||
$html.='<span class="badge badge-pill badge-warning '.($R['uid']==$featured_img_uid?'':'d-none').'" data-role="attachList-label-featured" data-id="'.$R['uid'].'">대표</span> ';
|
||||
$html.='<span class="badge badge-pill badge-secondary '.(!$R['hidden']?'d-none':'').'" data-role="attachList-label-hidden-'.$R['uid'].'">숨김</span>';
|
||||
$html.='
|
||||
<a href="'.$R['linkurl'].'" target="_blank" class="title d-inline" data-role="attachList-list-name-'.$R['uid'].'" >'.($R['caption']?getStrCut($R['caption'],45,'..'):getStrCut($R['description'],45,'..')).'</a>
|
||||
<div class="meta"><span class="badge badge-pill badge-light">'.$R['provider'].'</span> <span class="badge badge-pill badge-light" data-role="attachList-list-time-'.$R['uid'].'">'.$R['time'].'</span></div>';
|
||||
|
||||
$html.='
|
||||
<span class="d-block mt-2">
|
||||
<div class="btn-group btn-group-sm">';
|
||||
$html.='<input type="hidden" name="attachfiles[]" value="['.$R['uid'].']"/>';
|
||||
$html.='
|
||||
<button type="button" class="btn btn-light" data-act="linkInsert" data-provider="'.$R['provider'].'" data-url="'.$R['linkurl'].'" data-title="'.$R['caption'].'" data-id="'.$R['uid'].'" data-role="attachList-menu-edit-'.$R['uid'].'" role="button">삽입</button>
|
||||
<button type="button" class="btn btn-light" data-link-act="delete" data-id="'.$R['uid'].'" data-role="attachList-menu-delete-'.$R['uid'].'" data-featured="" data-type="'.($R['type']==8?'youtube':'file').'" role="button">삭제</button>';
|
||||
$html.='
|
||||
<div class="btn-group"><button type="button" class="btn btn-light dropdown-toggle" data-toggle="dropdown" role="button"></button>
|
||||
<div class="dropdown-menu dropdown-menu-right" role="menu">
|
||||
<button type="button" class="dropdown-item" data-link-act="featured-img" data-type="'.$type.'" data-id="'.$R['uid'].'">대표이미지 설정</button>
|
||||
<button type="button" class="dropdown-item" data-link-act="showhide" data-role="attachList-menu-showhide-'.$R['uid'].'" data-id="'.$R['uid'].'" data-content="'.($R['hidden']?'show':'hide').'" >'.($R['hidden']?'보이기':'숨기기').'</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</span>';
|
||||
|
||||
$html.='
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
||||
$html.='
|
||||
</li>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
?>
|
||||
158
modules/mediaset/themes/_desktop/bs4-default-link/main.js
Normal file
158
modules/mediaset/themes/_desktop/bs4-default-link/main.js
Normal file
@@ -0,0 +1,158 @@
|
||||
// 업로드 리스트 showhide 값 reset 함수
|
||||
var updateShowHide=function(uid,showhide){
|
||||
if(showhide=='show'){
|
||||
$('[data-role="attachList-menu-showhide-'+uid+'"]').attr('data-content','hide'); // data-content 값 수정
|
||||
$('[data-role="attachList-menu-showhide-'+uid+'"]').text('숨기기'); // 메뉴명 변경
|
||||
$('[data-role="attachList-label-hidden-'+uid+'"]').addClass('d-none'); // 숨김 라벨 숨기기
|
||||
console.log($('[data-role="attachList-label-hidden-'+uid+'"]'));
|
||||
}else{
|
||||
$('[data-role="attachList-menu-showhide-'+uid+'"]').attr('data-content','show'); // data-content 값 수정
|
||||
$('[data-role="attachList-menu-showhide-'+uid+'"]').text('보이기'); // 메뉴명 변경
|
||||
$('[data-role="attachList-label-hidden-'+uid+'"]').removeClass('d-none'); // 숨김 라벨 노출
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('click','[data-link-act]',function(e){
|
||||
var act=$(this).attr('data-link-act');
|
||||
var uid=$(this).attr('data-id');
|
||||
var type=$(this).attr('data-type'); // file or photo
|
||||
var module = 'mediaset';
|
||||
|
||||
showSaveButton(true) //포스트 저장버튼 활성화
|
||||
|
||||
if(act=='edit'){
|
||||
// data 값 세팅
|
||||
var modal=$(this).data('target');
|
||||
var filename=$(this).attr('data-filename'); // data-로 하면 변경된 값 적용 안됨
|
||||
var fileext=$(this).data('fileext');
|
||||
var caption=$(this).attr('data-caption'); // data- 로 하면 변경된 값 적용 안됨
|
||||
var img_thumb=$(this).data('src');// 미리보기 이미지
|
||||
var img_origin=$(this).data('origin');// 원본 이미지
|
||||
|
||||
// data 값 모달에 적용
|
||||
$(modal).find('[data-role="filename"]').val(filename);
|
||||
$(modal).find('[data-role="fileext"]').text(fileext);
|
||||
$(modal).find('[data-role="filecaption"]').val(caption);
|
||||
$(modal).find('[data-role="eventHandler"]').attr('data-id',uid); // save, cancel 엘리먼트 data-id="" 값에 uid 값 적용
|
||||
$(modal).find('[data-role="eventHandler"]').attr('data-type',type); // save, cancel 엘리먼트 data-type="" 값에 type 값 적용
|
||||
if(type=='photo'){
|
||||
$(modal).find('[data-role="img-preview"]').attr('src',img_thumb); // 미리보기 이미지 src 적용
|
||||
$(modal).find('[data-role="img-preview"]').attr('data-origin',img_origin); // 원본 이미지 src 적용
|
||||
} else if(type=='video'){
|
||||
$(modal).find('[data-role="img-preview"]').html('<i class="fa fa-file-video-o fa-4x"></i>'); // 타입별 아이콘 적용
|
||||
} else if(type=='audio'){
|
||||
$(modal).find('[data-role="img-preview"]').html('<i class="fa fa-file-audio-o fa-4x"></i>'); // 타입별 아이콘 적용
|
||||
} else {
|
||||
$(modal).find('[data-role="img-preview"]').html('<i class="fa fa-floppy-o fa-4x"></i>'); // 타입별 아이콘 적용
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//액션 실행
|
||||
if(act=='delete'){
|
||||
// 삭제하는 리스트가 대표 이미지인 경우 write.php input 값에 적용
|
||||
var is_featured=$(this).attr('data-featured');
|
||||
if(is_featured=='1' && type=='photo'){
|
||||
if(confirm('대표이미지를 삭제하시겠습니까? ')){
|
||||
$('input[name="featured_img"]').val('');
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$.post(rooturl+'/?r='+raccount+'&m='+module+'&a=delete',{
|
||||
uid : uid
|
||||
},function(response){
|
||||
var previewUl_default=$('[data-role="attach-preview-link"]'); // 파일 리스트 엘리먼트 class
|
||||
var previewUl_modal=$('[data-role="modal-attach-preview-link"]'); // 파일 리스트 엘리먼트 class
|
||||
var delEl_default=$(previewUl_default).find('[data-id="'+uid+'"]'); // 삭제 이벤트 진행된 엘리먼트
|
||||
var delEl_modal=$(previewUl_modal).find('[data-id="'+uid+'"]'); // 삭제 이벤트 진행된 엘리먼트
|
||||
delEl_default.remove();// 삭제 이벤트 진행시 해당 li 엘리먼트 remove
|
||||
delEl_modal.remove();// 삭제 이벤트 진행시 해당 li 엘리먼트 remove
|
||||
});
|
||||
}else if(act=='showhide'){
|
||||
var showhide=$(this).attr('data-content'); // data('content') 로 할 경우, ajax 로 변경된 값이 인식되지 않는다.
|
||||
$.post(rooturl+'/?r='+raccount+'&m='+module+'&a=edit',{
|
||||
act : act,
|
||||
uid : uid,
|
||||
showhide : showhide
|
||||
},function(response){
|
||||
var result=$.parseJSON(response);
|
||||
if(!result.error){
|
||||
updateShowHide(uid,showhide);
|
||||
}
|
||||
});
|
||||
}else if(act=='save'){ // 정보수정 저장
|
||||
var modal=$(this).data('target');
|
||||
var filename=$(modal).find('[data-role="filename"]').val(); // 입력된 파일명
|
||||
var filetype=$(modal).find('[data-role="eventHandler"]').attr('data-type'); // photo or file
|
||||
var fileext=$(modal).find('[data-role="fileext"]').text(); // 입력된 파일 확장자명
|
||||
var filecaption=$(modal).find('[data-role="filecaption"]').val(); // 입력된 캡션명
|
||||
var filesrc=$(modal).find('[data-role="img-preview"]').attr('data-origin'); // 원본 이미지 소스
|
||||
|
||||
$.post(rooturl+'/?r='+raccount+'&m='+module+'&a=edit',{
|
||||
act : act,
|
||||
uid : uid,
|
||||
filename : filename,
|
||||
filetype : filetype,
|
||||
fileext : fileext,
|
||||
filecaption : filecaption,
|
||||
filesrc : filesrc
|
||||
},function(response){
|
||||
var result=$.parseJSON(response);
|
||||
if(!result.error){
|
||||
var new_filename=result.filename;
|
||||
var new_filecaption=result.filecaption;
|
||||
var new_fileext=result.fileext;
|
||||
var new_filetype=result.filetype;
|
||||
var new_filesrc=result.filesrc;
|
||||
|
||||
// 리스트 값 수정
|
||||
$('[data-role="attachList-menu-edit-'+uid+'"]').attr('data-filename',new_filename); // 파일명 수정
|
||||
$('[data-role="attachList-menu-edit-'+uid+'"]').attr('data-caption',new_filecaption); // 'edit' 메뉴 캡션 업데이트
|
||||
$('[data-role="attachList-menu-insert-'+uid+'"]').attr('data-caption',new_filecaption); // 'insert' 메뉴 캡션내용 수정
|
||||
$('[data-role="attachList-list-name-'+uid+'"]').text(new_filename+'.'+new_fileext); // 리스트 name 수정
|
||||
$('[data-role="attachList-list-name-'+uid+'"]').attr('data-caption',new_filecaption); // 리스트에도 캡션 업데이트
|
||||
|
||||
// 모달 닫기
|
||||
$(modal).modal('hide');
|
||||
$(modal).find('[data-role="filename"]').val(''); // 입력된 파일명 초기화
|
||||
$(modal).find('[data-role="fileext"]').text(''); // 입력된 파일 확장자명 초기화
|
||||
$(modal).find('[data-role="filecaption"]').val(''); // 입력된 캡션명 초기화
|
||||
}
|
||||
});
|
||||
}else if(act=='featured-img'){ // 대표이미지 설정
|
||||
// write.php 페이지 <input name="featured_img" value > 값에 적용
|
||||
$('input[name="featured_img"]').val(uid);
|
||||
|
||||
|
||||
|
||||
// 대표 이미지 라벨 업데이트
|
||||
$('[data-role="attachList-label-featured"]').each(function(){
|
||||
$(this).addClass('d-none');
|
||||
// 삭제 메뉴에 대표이미지 표시 지우기
|
||||
$('[data-link-act="delete"]').attr('data-featured','');
|
||||
if($(this).data('id')==uid){
|
||||
$(this).removeClass('d-none');
|
||||
// 삭제 메뉴에 대표이미지 표시
|
||||
$('[data-role="attachList-menu-delete-'+uid+'"]').attr('data-featured',1);
|
||||
}
|
||||
});
|
||||
}else if(act=='insert'){
|
||||
var url=$(this).attr('data-url');
|
||||
console.log(url)
|
||||
InserHTMLtoEditor(editor,url)
|
||||
|
||||
var showhide= 'hide'; // 숨김처리
|
||||
$.post(rooturl+'/?r='+raccount+'&m='+module+'&a=edit',{
|
||||
act : act,
|
||||
uid : uid,
|
||||
showhide : showhide
|
||||
},function(response){
|
||||
var result=$.parseJSON(response);
|
||||
if(!result.error){
|
||||
updateShowHide(uid,showhide);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
34
modules/mediaset/themes/_desktop/bs4-default-link/main.php
Normal file
34
modules/mediaset/themes/_desktop/bs4-default-link/main.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
include $g['dir_attach_theme'].'/header.php';
|
||||
?>
|
||||
|
||||
<div id="attach_link">
|
||||
<fieldset id="check_url" class="mb-3">
|
||||
<div class="input-group" style="border: 2px dashed #d1d1d1;">
|
||||
<textarea class="form-control bg-white border-0" rows="3" placeholder="URL을 입력해주세요."></textarea>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-light border-right-0 border-top-0 border-bottom-0" type="button">
|
||||
가져오기
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<small class="form-text text-muted"></small>
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
<div class="rb-attach mb-3 dd" id="nestable-link">
|
||||
<ol class="list-group rb-attach-link rb-attach-featured bg-faded dd-list" data-role="attach-preview-link"> <!-- 일반파일 리스트 -->
|
||||
<?php if($parent_data['uid']):?>
|
||||
<?php echo getAttachPlatformList($parent_data,'upload','file')?>
|
||||
<?php endif?>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
include $g['dir_attach_theme'].'/footer.php';
|
||||
?>
|
||||
149
modules/mediaset/themes/_desktop/bs4-default-link/modals.php
Normal file
149
modules/mediaset/themes/_desktop/bs4-default-link/modals.php
Normal file
@@ -0,0 +1,149 @@
|
||||
<!-- 첨부 사진 메타정보 수정 -->
|
||||
<div class="modal fade rb-modal-attach-meta" id="modal-attach-photo-meta" tabindex="-1" role="dialog" aria-labelledby="">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id=""><i class="fa fa-camera-retro"></i> 사진 정보수정</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<!-- data-role="img-preview" src="_s 이미지" data-origin="원본 이미지" 넣는다. -->
|
||||
<div class="col-md-4">
|
||||
<p><img class="img-thumbnail" src="" alt="" data-role="img-preview" data-origin=""></p>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label for="file-caption" class="control-label">캡션:</label>
|
||||
<textarea class="form-control" data-role="filecaption" rows="5"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="file-name" class="control-label">파일명:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" data-role="filename" name="filename">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text" data-role="fileext">확장자</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal" data-attach-act="cancel" data-target="#modal-attach-photo-meta" data-role="eventHandler" data-id="">취소하기</button>
|
||||
<button type="button" class="btn btn-primary" data-attach-act="save" data-target="#modal-attach-photo-meta" data-role="eventHandler" data-id="">저장하기</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 첨부 파일 메타정보 수정 -->
|
||||
<div class="modal fade rb-modal-attach-meta" id="modal-attach-file-meta" tabindex="-1" role="dialog" aria-labelledby="">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id=""><i class="fa fa-floppy-o"></i> 첨부파일 정보수정</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h1 class="text-xs-center" data-role="img-preview">
|
||||
</h1>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label for="file-name" class="control-label">파일명:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="filename" data-role="filename">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text" data-role="fileext">확장자</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="file-caption" class="control-label">캡션:</label>
|
||||
<textarea class="form-control" data-role="filecaption" name="caption"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal" data-attach-act="cancel" data-target="#modal-attach-file-meta" data-role="eventHandler" data-id="">취소하기</button>
|
||||
<button type="button" class="btn btn-primary" data-attach-act="save" data-target="#modal-attach-file-meta" data-role="eventHandler" data-id="" data-type="">저장하기</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 링크 추가 -->
|
||||
<div class="modal fade" tabindex="-1" role="dialog" id="modal-attach-link">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">링크 추가</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="attach-link">
|
||||
<!--링크 입력 필드 동적 생성 -->
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-primary" data-plugin="clipboard" data-clipboard-text="" data-role="btn-copy-linkContent">링크내용 복사하기</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
|
||||
<!-- 위치 추가 -->
|
||||
<div class="modal fade" tabindex="-1" role="dialog" id="modal-attach-map">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">위치 추가</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>지도 검색 UI </p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-primary">적용하기</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
|
||||
<!-- 비디오 추가 -->
|
||||
<div class="modal fade" tabindex="-1" role="dialog" id="modal-attach-video">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">비디오 추가</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>유튜브와 비메오 비디오만 링크를 추가하는 형태</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-primary">적용하기</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
@@ -0,0 +1 @@
|
||||
부트스트랩 심플 기본형
|
||||
Reference in New Issue
Block a user