웨지익 그누보드 썸머노트 에디터 summernote-master_11q_0.90_11qkr_v1.7z
작성자 정보
- 최고관리자 작성
- 192.♡.0.1 아이피
- 작성일
컨텐츠 정보
- 627 조회
- 1 댓글
- 목록
링크
첨부
등록일
2026.01.12 21:45
본문
웨지익 그누보드 썸머노트 에디터 summernote-master_11q_0.90_11qkr_v1.7z
현제 사용중인 에디터를 재구성 합니다 > 2026_0112_2146_46
w:\g5\plugin\editor\summernote-master_11q_0.90_11qkr_v1.7z
기본 수정 파일
1) W:\g5\plugin\editor\summernote-master_11q_0.90_11qkr_v1\editor.lib.php
<?php
// W:g5plugineditorsummernote-master_11q_0.90editor.lib.php 2026_0112_2136_50
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
function editor_html($id, $content, $is_dhtml_editor=true)
{
global $g5, $config;
static $js = true;
$editor_url = G5_EDITOR_URL.'/'.$config['cf_editor'];
$html = "";
$html .= "<span class="sound_only">Summernote 시작</span>";
if ($is_dhtml_editor && $js) {
ob_start();
?>
<link rel="stylesheet" href="<?php echo $editor_url ?>/summernote/summernote-lite.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css">
<link rel="stylesheet" href="<?php echo $editor_url ?>/style.css">
<script src="<?php echo $editor_url ?>/summernote/summernote-lite.min.js"></script>
<script src="<?php echo $editor_url ?>/summernote/lang/summernote-ko-KR.min.js"></script>
<script src="<?php echo $editor_url ?>/config.js"></script>
<!-- 9999999999999999999999999999999999999999999999999999999999 -->
<script type="text/javascript">
// bootstrap 설정 입니다
function sendFile(file, editor) {
data = new FormData();
data.append("SummernoteFile", file);
$.ajax({
data: data,
type: "POST",
url: "<?php echo $editor_url ?>/upload.php",
cache: false,
contentType: false,
processData: false,
success: function(data) {
var obj = JSON.parse(data);
if (obj.success) {
$(editor).summernote("insertImage", obj.save_url);
} else {
switch(parseInt(obj.error)) {
case 1: alert('업로드 용량 제한에 걸렸습니다.'); break;
case 2: alert('MAX_FILE_SIZE 보다 큰 파일은 업로드할 수 없습니다.'); break;
case 3: alert('파일이 일부분만 전송되었습니다.'); break;
case 4: alert('파일이 전송되지 않았습니다.'); break;
case 6: alert('임시 폴더가 없습니다.'); break;
case 7: alert('파일 쓰기 실패'); break;
case 8: alert('알수 없는 오류입니다.'); break;
case 100: alert('이미지 파일이 아닙니다.(jpeg, jpg, gif, bmp, png 만 올리실 수 있습니다.)'); break;
case 101: alert('이미지 파일이 아닙니다.(jpeg, jpg, gif, bmp, png 만 올리실 수 있습니다.)'); break;
case 102: alert('0 byte 파일은 업로드 할 수 없습니다.'); break;
}
}
}
});
}
</script>
<script src="<?php echo $editor_url ?>/config.js"></script>
<?php
$html .= ob_get_contents();
ob_end_clean();
$js = false;
}
$summernote_class = $is_dhtml_editor ? "summernote" : "";
$html .= "n<textarea id="$id" name="$id" class="$summernote_class" >$content</textarea>";
$html .= "n<span class="sound_only">Summernote 끝</span>";
return $html;
}
// textarea 로 값을 넘긴다. javascript 반드시 필요
function get_editor_js($id, $is_dhtml_editor=true)
{
if ($is_dhtml_editor) {
return "var {$id}_editor_data = $('#{$id}').summernote('code');";
} 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) { alert("내용을 입력해 주십시오."); $('#{$id}').summernote('focus'); return false; }n";
} else {
return "if (!{$id}_editor.value) { alert("내용을 입력해 주십시오."); {$id}_editor.focus(); return false; }n";
}
}
?>
2) w:\g5\plugin\editor\summernote-master_11q_0.90_11qkr_v1\style.css
/* =========================================================
Summernote SAFE STYLE (Gnuboard Compatible)
- fullscreen edit OK
- popup(dialog) input OK
- z-index / overlay / pointer-events safe
========================================================= */
/* ---------------------------------------------------------
기본 에디터 프레임
--------------------------------------------------------- */
.note-editor.note-frame {
font-family: 'Noto Sans KR', '맑은 고딕', sans-serif;
font-size: 15px;
border-radius: 8px;
border: 1px solid #ddd;
background: #fff;
}
/* ---------------------------------------------------------
에디터 본문 영역
--------------------------------------------------------- */
.note-editable {
padding: 15px 20px;
line-height: 1.7;
background: #fff;
color: #000;
user-select: text !important;
}
/* 문단 */
.note-editable p {
margin: 0.5em 0;
}
/* 제목 */
.note-editable h1 { font-size: 2.2em; font-weight: 700; margin: .6em 0; }
.note-editable h2 { font-size: 1.8em; font-weight: 700; margin: .6em 0; }
.note-editable h3 { font-size: 1.5em; font-weight: 600; margin: .6em 0; }
.note-editable h4 { font-size: 1.3em; font-weight: 600; margin: .5em 0; }
.note-editable h5 { font-size: 1.15em; font-weight: 500; margin: .4em 0; }
.note-editable h6 { font-size: 1.0em; font-weight: 500; margin: .4em 0; }
/* 이미지 */
.note-editable img {
max-width: 100%;
height: auto;
}
/* ---------------------------------------------------------
툴바
--------------------------------------------------------- */
.note-toolbar {
background: #f8f9fa;
border-bottom: 1px solid #ddd;
}
.note-toolbar .note-btn {
font-weight: 600;
border-radius: 6px;
}
/* ---------------------------------------------------------
FULLSCREEN (⚠ 핵심 제어)
--------------------------------------------------------- */
.note-editor.note-frame.fullscreen,
.note-editor.note-airframe.fullscreen {
position: fixed !important;
top: 0 !important;
left: 0 !important;
width: 100% !important;
height: 100% !important;
background: #fff !important;
z-index: 2147483000 !important;
/* 기본 fullscreen 편집은 허용 */
pointer-events: auto !important;
}
/* fullscreen 리사이즈바 제거 */
.note-editor.fullscreen .note-resizebar {
display: none !important;
}
/* fullscreen 상태 body 스크롤 차단 */
body.note-fullscreen-mode {
overflow: hidden !important;
}
/* ---------------------------------------------------------
dialog 열렸을 때만 editor 차단 (🔥 정답)
--------------------------------------------------------- */
body.note-dialog-open .note-editor.note-frame.fullscreen,
body.note-dialog-open .note-editor.note-airframe.fullscreen {
pointer-events: none !important;
}
/* ---------------------------------------------------------
MODAL / POPUP (입력 불가 완전 해결)
--------------------------------------------------------- */
.note-modal {
position: fixed !important;
z-index: 2147483647 !important;
background: transparent !important;
pointer-events: auto !important;
}
/* Bootstrap backdrop 제거 */
.modal-backdrop {
display: none !important;
}
/* modal 내용 영역 */
.note-modal-content {
background: #fff !important;
border-radius: 8px;
opacity: 1 !important;
pointer-events: auto !important;
box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
/* modal 내부 전체 활성 */
.note-modal * {
pointer-events: auto !important;
}
/* input / textarea 강제 활성 */
.note-modal input,
.note-modal textarea,
.note-modal select {
background: #fff !important;
color: #000 !important;
opacity: 1 !important;
pointer-events: auto !important;
}
/* placeholder 색상 */
.note-modal input::placeholder,
.note-modal textarea::placeholder {
color: #888 !important;
}
/* ---------------------------------------------------------
코드뷰 / 코드 입력
--------------------------------------------------------- */
.note-editor .note-codable {
background: #1e1e1e;
color: #d4d4d4;
font-family: Consolas, Monaco, monospace;
font-size: 14px;
}
/* ---------------------------------------------------------
검색 / 치환 강조
--------------------------------------------------------- */
.note-editable mark {
background-color: #ffeb3b;
color: #000;
font-weight: bold;
}
/* ---------------------------------------------------------
불필요한 overlay 차단 (재발 방지)
--------------------------------------------------------- */
.note-editor::before,
.note-editor::after,
.note-editor.fullscreen::before,
.note-editor.fullscreen::after {
content: none !important;
display: none !important;
}
/* opacity / filter 상속 차단 */
.note-editor,
.note-modal,
.note-modal-content {
opacity: 1 !important;
filter: none !important;
}
/* 포커스 outline 제거 */
[contenteditable="true"]:focus {
outline: none;
}
/* ========================================================= */
3) w:\g5\plugin\editor\summernote-master_11q_0.90_11qkr_v1\config.js
// W:g5plugineditorsummernote-master_11q_0.90config.js
(function($){
$(document).ready(function(){
/** 🟢 Summernote 초기화 */
$(".summernote").summernote({
lang: 'ko-KR',
height: 300,
dialogsInBody: true, // 모달 항상 body에 생성
fontNames: [
'맑은 고딕','굴림','돋움','바탕','궁서',
'Arial','Courier New','Comic Sans MS','Impact',
'Tahoma','Times New Roman','Verdana'
],
fontNamesIgnoreCheck: ['맑은 고딕','굴림','돋움','바탕','궁서'],
toolbar: [
['style', ['style']],
['font', ['bold','italic','underline','strikethrough','superscript','subscript','clear']],
['fontname',['fontname']],
['fontsize',['fontsize']],
['color',['color']],
['para',['ul','ol','paragraph']],
['height',['height']],
['table',['table']],
['insert',['link','picture','video','findreplace']],
['view',['fullscreen','codeview']],
['edit', ['undo', 'redo']],
['help', ['help', 'ctrlFHint']]
],
buttons: {
/** 🔹 단축키 안내 버튼 */
ctrlFHint: function(context){
var ui = $.summernote.ui;
return ui.button({
contents: '<i class="fa-solid fa-keyboard"></i>',
tooltip: '정보',
click: function(){
alert(
"📘 정보안내nn"+
"Ctrl + F : 브라우저 기본 찾기n"+
"Ctrl + Z / Y : 실행취소 / 다시실행n"+
"Ctrl + B / I / U : 굵게, 기울임, 밑줄n" +
"전체 화면에서 에러 발생 스킨기본 수정화면에서 다음찾기후 전체바꾸기사용n"+
"Ver Info n"+
"썸머노트 0.9 + https://11q.kr 2025_1111_1334_39n"
);
}
}).render();
},
/** 🔹 찾기 / 바꾸기 버튼 */
findreplace: function(context){
var ui = $.summernote.ui;
return ui.button({
contents: '<i class="fa-solid fa-magnifying-glass"></i>',
tooltip: '찾기/바꾸기',
click: function(){
// 모달 생성 (최초 1회만)
if(!$('#sr-modal').length){
var modalHtml = `
<div class="modal fade" id="sr-modal" tabindex="-1" aria-hidden="true" style="z-index:21000;">
<div class="modal-dialog modal-dialog-centered" style="max-width:620px;">
<div class="modal-content p-3">
<div class="row g-2 align-items-center">
<div class="col-md-4">
<input type="text" class="form-control" id="sr-find-text" placeholder="찾을 내용">
</div>
<div class="col-md-4">
<input type="text" class="form-control" id="sr-replace-text" placeholder="바꿀 내용">
</div>
<div class="col-md-4 d-flex gap-1">
<button class="btn btn-primary flex-fill" id="sr-find-next">다음찾기</button>
<button class="btn btn-success flex-fill" id="sr-replace">바꾸기</button>
<button class="btn btn-warning flex-fill" id="sr-replace-all">전체바꾸기</button>
</div>
</div>
</div>
</div>
</div>`;
$('body').append(modalHtml);
}
// 모달 표시
$('#sr-modal').modal('show');
$('#sr-find-text').focus();
}
}).render();
}
},
callbacks: {
/** 🖼 이미지 업로드 처리 */
onImageUpload: function(files){
var maxSize = 111 * 1024 * 1024; // 1MB
for(var i=0;i<files.length;i++){
if(files[i].size>maxSize){
alert('['+files[i].name+'] 용량 초과(1MB)');
}else{
sendFile(files[i], this);
}
}
},
/** 📋 붙여넣기 시 Base64 이미지 방지 */
onPaste: function(e){
var clipboardData = e.originalEvent.clipboardData;
if(clipboardData && clipboardData.items && clipboardData.items.length){
for(var i=0;i<clipboardData.items.length;i++){
if(clipboardData.items[i].type.indexOf("image")!==-1){
e.preventDefault();
}
}
}
}
}
});
/** 🔁 전체화면 토글 시 모달 위치 재조정 */
$(document).on('click', '.note-btn.fullscreen', function(){
setTimeout(function(){
$('#sr-modal').appendTo('body');
}, 500);
});
/** 🔍 찾기/바꾸기 동작 헬퍼 */
function getEditorCode(){ return $('.summernote').summernote('code'); }
function setEditorCode(html){ $('.summernote').summernote('code', html); }
/** 🔹 다음찾기 */
$(document).on('click','#sr-find-next',function(){
var val = $('#sr-find-text').val();
if(!val) return;
var editor = $('.summernote')[0];
var html = getEditorCode();
html = html.replace(/<mark class="sr-highlight">|</mark>/g,''); // 기존 강조 제거
setEditorCode(html);
// 선택 범위 강조 + 스크롤 이동
var range = editor.contentWindow || editor;
var $firstMark = $('.summernote').find('mark.sr-highlight').first();
if($firstMark.length){
$firstMark[0].scrollIntoView({behavior:'smooth', block:'center'});
}
// 모든 일치 강조
var regex = new RegExp(val,'gi');
var highlighted = getEditorCode().replace(regex,'<mark class="sr-highlight" style="background:yellow;">$&</mark>');
setEditorCode(highlighted);
});
/** 🔹 바꾸기 */
$(document).on('click','#sr-replace',function(){
var val = $('#sr-find-text').val();
var rep = $('#sr-replace-text').val();
if(!val) return;
var html = getEditorCode();
html = html.replace(val,rep); // 첫 번째만
setEditorCode(html);
});
/** 🔹 전체바꾸기 */
$(document).on('click','#sr-replace-all',function(){
var val = $('#sr-find-text').val();
var rep = $('#sr-replace-text').val();
if(!val) return;
var html = getEditorCode();
html = html.replace(new RegExp(val,'g'),rep);
setEditorCode(html);
});
});
})(jQuery);
// <!-- 888888888888888888888888888888888 -->
// <!-- // summernote 글쓰기/수정 화면 상단에 추가 START 2025_1111_1357_55
// // W:g5skinboardBS4-Basic-Webzine_11q_pdf_php82write.skin.php -->
// <?php $wr_content = $_POST['wr_content']; ?>
// <script type="text/javascript">
// // json_encode는 문자열을 안전하게 JS 문자열로 만들어 줍니다 (줄바꿈/따옴표 문제 해결)
// var wr_content = <?php echo json_encode($write_content, JSON_HEX_APOS | JSON_HEX_QUOT); ?>;
// </script>
// <!-- // summernote 글쓰기/수정 화면 상단에 추가 END -->
// <!-- 999999999999999999999999999999999 -->첨부 파일을 스킨보드에 구성 PDF보기( W:\g5\skin\board\BS4-Basic-Webzine_11q_pdf_php82\view.skin.php + view_pdf.php구성)
관련자료
-
링크
-
첨부등록일 2026.01.12 21:45
-
이전
-
다음
댓글 1
빨강모자님의 댓글
- 빨강모자
- 아이피 121.♡.126.148
- 작성일
감사합니다