ckeditor shortcut 안내를 jquery load 로 변경
This commit is contained in:
@ -10,26 +10,31 @@ function editor_html($id, $content, $ckeditor=true, $class="")
|
||||
$html .= "<span class=\"sound_only\">웹에디터 시작</span>";
|
||||
$html .= "<div class=\"cke_sc\"><button type=\"button\" class=\"btn_cke_sc\">단축키 일람</button></div>";
|
||||
|
||||
ob_start();
|
||||
include_once("shortcut.php");
|
||||
$html .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
if ($js) {
|
||||
$html .= "\n".'<script src="'.G4_CKEDITOR_URL.'/ckeditor.js"></script>';
|
||||
$html .= "\n".'<script>var g4_ckeditor_url = "'.G4_CKEDITOR_URL.'";</script>';
|
||||
$html .= "\n".'<script src="'.G4_CKEDITOR_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();
|
||||
} else {
|
||||
$(this).after("<div class=\'cke_sc_def\' />").next("div.cke_sc_def").load("'.G4_CKEDITOR_URL.'/shortcut.html");
|
||||
}
|
||||
});
|
||||
$(".btn_cke_sc_close").live("click",function(){
|
||||
$(this).parent("div.cke_sc_def").remove();
|
||||
});
|
||||
});';
|
||||
$html .= "\n</script>";
|
||||
$js = false;
|
||||
}
|
||||
|
||||
$ckeditor_class = $ckeditor ? "ckeditor" : "";
|
||||
$html .= "\n<textarea id=\"$id\" name=\"$id\" class=\"$ckeditor_class $class\" style=\"width:100%;\">$content</textarea>";
|
||||
$html .= "\n<span class=\"sound_only\">웹 에디터 끝</span>";
|
||||
$html .= "\n<script>";
|
||||
$html .= "$('.btn_cke_sc').click(function(){";
|
||||
$html .= "$('.cke_sc_def').toggleClass('cke_sc_def_on');";
|
||||
$html .= "\n});";
|
||||
$html .= "\n</script>";
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user