해피정

SmartEdior2 모바일(스마트폰) 글쓰기를 할때 사진첨부 무한로딩 문제

· 2020-10-11 (일) 11:54:36 · 6146 · 2

[주] 이후 강좌수정내용의 업데이트가 안될수 있습니다.
본 강좌의 최신업데이트는 https://www.happyjung.com/lecture/2946 에서 확인가능합니다.
가급적 동일한 내용을 유지하려고 노력하지만, 우선 작업은 위 링크입니다.


 

SmartEdior2 를 이용해서 스마트론에서 글쓰기를 할때 사진첨부 를 눌러서 이미지를 업로드 하고자 할때 무한 로딩이 걸리는 현상이 확인되었습니다.

문제없는 브라우저 : iPhone ( Chrome )
문제있는 브라우저 : iPhone ( Safari, Edge, Whale, Opera)

plugin / editor / smarteditor2 / photo_upload / popup / index.html

        <div class="drag_explain">
            <p>마우스로 드래그하여 순서를 바꿀수 있습니다.</p>
            <div class="file_selet_group">
            <span class="btn btn-success fileinput-button">
                <span>파일선택</span>
                <!-- The file input field used as target for the file upload widget -->
                <input id="fileupload" type="file" name="files[]" multiple accept="image/*">
            </span>
            <button type="button" class="btn btn-danger delete" id="all_remove_btn">
                <span>전체삭제</span>
            </button>
            </div>
        </div>
        <div class="drag_area" id="drag_area">
            <ul class="sortable" id="sortable">
            </ul>
            <em class="blind">마우스로 드래그해서 이미지를 추가해주세요.</em><span id="guide_text" class="bg hidebg"></span>
        </div>
        <div class="seletion_explain">이미지는 한번에 10개까지 선택할수 있습니다.</div>
        <div class="btn_group">
            <button type="button" class="btn" id="img_upload_submit">
                <span>등록</span>
            </button>
            <button type="button" class="btn" id="close_w_btn" >
                <span>취소</span>
            </button>
        </div>

를 아래와 같이 변경합니다

<?php 
// if (G5_IS_MOBILE) { // 그누보드 변수 활용 불가
if(preg_match('/(phone|samsung|lgtel|mobile|[^A]skt|nokia|blackberry|BB10|android|sony|SonyEricsson|DoCoMo|JVodafone|SoftBank|MOT-|UP.Browser|KDDI|WILLCOM|SHARP|DDIPOCKET|PSP|SymbianOS|Windows CE|webOS|PalmOS)/i', $_SERVER['HTTP_USER_AGENT']))
{ 
    //echo "모바일"; 
?>
        <div class="drag_area" id="drag_area" style="width:100%; text-align: center;">
                <div style="margin:0 auto; text-align: center; padding-top:80px; line-height:2em;">
                모바일에서는 스마트폰 보안강화로 인하여<br>
                <strong>사진 첨부하기</strong> 기능이 지원되지 않습니다.<br>
                글쓰기 하단의 파일 첨부를 이용해주세요.
                </div>
        </div>
        <div class="btn_group">
            <button type="button" class="btn" id="close_w_btn" >
                <span>닫기</span>
            </button>
        </div>
<?php // PC 일때
} else { 
    //echo "PC"; 
?>
        <div class="drag_explain">
            <p>마우스로 드래그하여 순서를 바꿀수 있습니다.</p>
            <div class="file_selet_group">
            <span class="btn btn-success fileinput-button">
                <span>파일선택</span>
                <!-- The file input field used as target for the file upload widget -->
                <input id="fileupload" type="file" name="files[]" multiple accept="image/*">
            </span>
            <button type="button" class="btn btn-danger delete" id="all_remove_btn">
                <span>전체삭제</span>
            </button>
            </div>
        </div>
        <div class="drag_area" id="drag_area">
            <ul class="sortable" id="sortable">
            </ul>
            <em class="blind">마우스로 드래그해서 이미지를 추가해주세요.</em><span id="guide_text" class="bg hidebg"></span>
        </div>
        <div class="seletion_explain">이미지는 한번에 10개까지 선택할수 있습니다.</div>
        <div class="btn_group">
            <button type="button" class="btn" id="img_upload_submit">
                <span>등록</span>
            </button>
            <button type="button" class="btn" id="close_w_btn" >
                <span>취소</span>
            </button>
        </div>
<?php } ?>

|

댓글 2개

감사합니다
2020-10-14 (수) 18:45:37
감사합니다~~^^*
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

2,788건
+
제목 글쓴이 날짜 조회
20-10-13 조회 5,794
20-10-11 조회 7,251
20-10-11 조회 6,147
20-10-08 조회 7,564
20-10-08 조회 6,026
20-10-07 조회 7,532
20-10-04 조회 7,383
20-09-28 조회 7,652
20-09-26 조회 8,516
20-09-25 조회 1만
20-09-24 조회 6,386
20-09-22 조회 8,857
20-09-21 조회 6,269
20-09-17 조회 5,774
20-09-16 조회 6,609
20-09-16 조회 6,647
20-09-13 조회 8,604
20-09-11 조회 7,633
20-09-10 조회 7,154
20-09-10 조회 5,626
20-09-08 조회 5,556
20-09-08 조회 7,142
20-09-08 조회 5,593
20-09-07 조회 7,607
20-09-05 조회 9,267
20-09-02 조회 7,632
20-08-31 조회 8,019
20-08-29 조회 8,950
20-08-28 조회 6,555
20-08-27 조회 5,083