답변 2개
4년 전
자체적으로 해결하였습니다 :)
/plugin/editor/jodit/editor.lib.php 파일에서 스크립트 부분을 아래와 같이 수정해주어야합니다.
if ($is_dhtml_editor && $js) { 와 } 사이의 스크립트를 아래와 같이 바꿔줍니다.
수정된 부분
1) 스크립트 상단 추가
<script>
(function($){
$(document).ready(function() {
$(".jodit").each(function (){
2) var '.$id.'_editor = new Jodit("#'.$id.'",{ => var '.$id.'_editor = new Jodit(this,{ 변경
3) 스크립트 하단 추가
});
});
})(jQuery);
</script>
수정 전체 코드
</p>
<p> if ($is_dhtml_editor && $js) { </p>
<p> $html .= "\n".'<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jodit/3.4.25/jodit.min.css">';</p>
<p> $html .= "\n".'<script src="//cdnjs.cloudflare.com/ajax/libs/jodit/3.4.25/jodit.min.js"></script>';</p>
<p> $html .= "\n".'</p>
<p> <script></p>
<p> (function($){ //추가</p>
<p> $(document).ready(function() { //추가</p>
<p> $(".jodit").each(function (){ //추가 </p>
<p> var '.$id.'_editor = new Jodit(this,{ //수정</p>
<p> uploader: {</p>
<p> url: "'.$editor_url.'/upload.php?bo_table='.$bo_table.'",</p>
<p> insertImageAsBase64URI: false,</p>
<p> imagesExtensions: ["jpg", "png", "jpeg", "gif"],</p>
<p> process: function (resp) {</p>
<p> for(var i=0;i<resp.data.images.length;i++){</p>
<p> '.$id.'_editor.setEditorValue('.$id.'_editor.getEditorValue() +"<img src=\'" + resp.data.baseurl + "/" + resp.data.images[i] + "\'>");</p>
<p> }</p>
<p> }</p>
<p> },</p>
<p> height:300,</p>
<p> allowResizeX: true,</p>
<p> allowResizeY: true,</p>
<p> });</p>
<p> }); //추가</p>
<p> }); //추가</p>
<p> })(jQuery); //추가 </p>
<p> </script>';</p>
<p> $js = false;</p>
<p> }</p>
<p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
그런데 기본 코드에서 이미 아이디가 입력폼 아이디에 맞게 잘 들어가진 것으로 확인되어집니다.
/plugin/editor/jodit/editor.lib.php 파일입니다.
[code]
<textarea id="ca_head_html" name="ca_head_html" class="jodit" maxlength="65536" style="width: 100%; height: 500px; display: none;"></textarea>
<script>
var ca_head_html_editor = new Jodit("#ca_head_html",{
uploader: {
url: "https://XXX.com/plugin/editor/jodit/upload.php",
insertImageAsBase64URI: false,
imagesExtensions: ["jpg", "png", "jpeg", "gif"],
process: function (resp) {
for(var i=0;i<resp.data.images.length;i++){
ca_head_html_editor.setEditorValue(ca_head_html_editor.getEditorValue() +"<img src='" + resp.data.baseurl + "/" + resp.data.images[i] + "'>");
}
}
},
height:300,
allowResizeX: true,
allowResizeY: true,
});
</script>
[/code]