2
저는 자바 전문가가 아니기 때문에이 작은 버튼 플러그인이 Cleditor에서 가정되는 바를 수행하는 이유에 대해 다소 혼란 스럽지만 jquery 편집기가 오류 경고를 표시합니다.Cleditor - 마이너 플러그인 오류
(function($) {
// Define the hello button
$.cleditor.buttons.video = {
name: "video",
image: "video.gif",
title: "Insert Video",
command: "inserthtml",
buttonClick: videoClick
};
// Add the button to the default controls before the bold button
$.cleditor.defaultOptions.controls = $.cleditor.defaultOptions.controls
.replace("bold", "video bold");
// Handle the hello button click event
function videoClick(e, data) {
// Get the editor
var editor = data.editor;
// Insert some html into the document
var html = "[VIDEO]";
editor.execCommand(data.command, html, null, data.button);
// Hide the popup and set focus back to the editor
// editor.focus();
}
})(jQuery);
그것은 당신이 버튼을 클릭하면 문서에 [VIDEO]를 삽입하는 간단한 플러그인은 다음과 같습니다 여기
는 코드입니다.문제는 몇 가지 이유로이가
오는 텍스트를 삽입 한 후 것입니다 "오류 발생 insertHTML를 명령 실행"플러그인 버튼 아래에 작은 노란색 창에서합니다.
Javascript에 대한 경험 부족으로 인해 내가 누락 된 내용 인 것으로 확신합니다.
에 대한 jsfiddle입니다. – MadScientist