P

$html 변수에 들어가는 값이 일부만 들어갑니다.

· 11년 전 · 876 · 3

정말 수고하십니다^^


오류 주소 : plugin/editor/smarteditor2/editor.lib.php


$html 변수에 들어가는 값이
$(this).text("단축키 일람 닫기"); 까지만 들어가고요...
그 이후로는 값이 $html 변수에 들어가지 않습니다.

따라서 제가 원하는 작업(<textarea 태그안에 readonly )를 설정하려고 하는데... 그게 안되네요^^;


해당 파일 소스 입니다

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

function editor_html($id, $content, $is_dhtml_editor=true)
{
    global $g5, $config;
    global $w, $have_comment; // 내가 추가한 변수
    static $js = true;


    $editor_url = G5_EDITOR_URL.'/'.$config['cf_editor'];

    $html = "";
    $html .= "<span class=\"sound_only\">웹에디터 시작</span>";
 

    if ($is_dhtml_editor) $html .= '<script>document.write("<div class=\'cke_sc\'><button type=\'button\' class=\'btn_cke_sc\'>단축키 일람</button></div>");</script>';

    if ($is_dhtml_editor && $js) {
        $html .= "\n".'<script src="'.$editor_url.'/js/HuskyEZCreator.js"></script>';
        $html .= "\n".'<script>var g5_editor_url = "'.$editor_url.'", oEditors = [];</script>';
        $html .= "\n".'<script src="'.$editor_url.'/config.js"></script>';
        $html .= "\n<script>";
        $html .= '
 

        $(function(){
            $(".btn_cke_sc").click(function(){
                if ($(this).next("div.cke_sc_def").length) {
                    $(this).next("div.cke_sc_def").remove();
                    $(this).text("단축키 일람");
                } else {
                    $(this).after("<div class=\'cke_sc_def\' />").next("div.cke_sc_def").load("'.$editor_url.'/shortcut.html");
                  $(this).text("단축키 일람 닫기"); <================== 여기까지만 값이 들어가요 !!!^^
              
}
            });
            $(".btn_cke_sc_close").live("click",function(){
            $(this).parent("div.cke_sc_def").remove();
        });
   });';
 

    $html .= "\n</script>";
    $js = false;

}

    $smarteditor_class = $is_dhtml_editor ? "smarteditor2" : "";
    $html .= "\n<textarea id=\"$id\" name=\"$id\" class=\"$smarteditor_class\" maxlength=\"65536\" style=\"width:100%\">$content</textarea>";
    $html .= "\n<span class=\"sound_only\">웹 에디터 끝</span>";
    return $html;
}


// textarea 로 값을 넘긴다. javascript 반드시 필요
function get_editor_js($id, $is_dhtml_editor=true)
{
    if ($is_dhtml_editor) {
        return "var {$id}_editor_data = oEditors.getById['{$id}'].getIR();\noEditors.getById['{$id}'].exec('UPDATE_CONTENTS_FIELD', []);\nif(jQuery.inArray(document.getElementById('{$id}').value.toLowerCase().replace(/^\s*|\s*$/g, ''), [' ','<p> </p>','<p><br></p>','<div><br></div>','<p></p>','<br>','']) != -1){document.getElementById('{$id}').value='';}\n";
    } else {
        return "var {$id}_editor = document.getElementById('{$id}');\n";
    }
}


// textarea 의 값이 비어 있는지 검사
function chk_editor_js($id, $is_dhtml_editor=true)
{
    if ($is_dhtml_editor) {
        return "if (!{$id}_editor_data || jQuery.inArray({$id}_editor_data.toLowerCase(), [' ','<p> </p>','<p><br></p>','<p></p>','<br>']) != -1) { alert(\"내용을 입력해 주십시오.\"); oEditors.getById['{$id}'].exec('FOCUS'); return false; }\n";
    } else {
        return "if (!{$id}_editor.value) { alert(\"내용을 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";
    }
}
?>

|

댓글 3개

코드를 수정 하신 경우라면,
QA 게시판에 질문을 남겨주세요.
이건...원본으로 알고있습니다^^;
지금 새로... 설치해봐도... 같은 부분까지만 $html 변수에 값이 들어갑니다.

혹시 변수에 문자열이 들어가는 길이를 넘어서서 더이상 들어가지 않을까 합니다
댓글을 작성하시려면 로그인이 필요합니다.

버그신고

  문의게시판을 이용해 주세요 :) https://sir.kr/co_qa  

+
분류 제목 글쓴이 날짜 조회
11년 전 조회 685
11년 전 조회 756
11년 전 조회 2
11년 전 조회 620
11년 전 조회 617
11년 전 조회 1,093
11년 전 조회 1,288
11년 전 조회 875
11년 전 조회 630
11년 전 조회 877
11년 전 조회 873
11년 전 조회 688
11년 전 조회 645
11년 전 조회 545
11년 전 조회 685
11년 전 조회 3
11년 전 조회 1,728
11년 전 조회 722
11년 전 조회 786
11년 전 조회 553