Comments (3)
저도 그부분을 찾고 있었는데요.
제가 구현한 부분의 흐름은...
업로드된 이미지 목록과 본문내의 이미지를 매칭시킬 class 값을 동일하게 해서 등록 합니다.
예 이미지목록에 삭제 버튼에는
< input type='button' value='삭제' imgcls='image_class_in_editor' onclick='delImg(this)'>
본문 내용에 이미지를 삽입할때는
< img src='...' class='image_class_in_editor'>
이런식으로 넣어서 삭제 버튼의 imgcls 값을 본문 html값에서 찾아서 해당 이미지 태그 삭제 하고
다시 html을 적용하는 방식입니다.
그런데...
예전에는 php 업로더 예제에 해당 플러그인이 포함 되어 있어서 쉽게 처리 할 있었습니다.
만약 업로드예제(photo_uploader 폴더)가 있다면
oEditors.getById[edit_txtid].exec("REMOVE_INN_IMG", [o.val(),imgcls]);
이런 식으로 가능했습니다.
지금 버전에서는 해당 예제가 없어져서 이전 버전의 플러그인을 가져와 사용하시거나,
아래 코드를 응용하시면 될 듯 합니다.
function deltInnerImg(obj){
imgcls = $(obj)attr("imglcs");
sContents = oEditors.getById[edit_txtid].getContents();
ptn = eval('/<img [^<]'+imgcls+'[^>]>/gi');
sContents = sContents.replace(ptn, "");
oEditors.getById[edit_txtid].setContents(sContents);
$(obj).remove();
}
from smarteditor2.
그리고...
2.8버전에 있는 photo_uploader 예제를 이용하시는 거라면
photo_uploader/plugin/hp_SE2M_AttachQuickPhoto.js 파일의
137번 줄 $ON_REMOVE_INN_IMG:function (imgsrc) {
를
$ON_REMOVE_INN_IMG:function (imgsrc,imgcls) {
로 수정 하셔야 할겁니다.
from smarteditor2.
으 말씀하신 내용을 못보고 indexOf 를 이용해서 해결했습니다.
말씀하신 deltInnerImg 펑션을 보니 전 왜 저런생각을 못했을까 싶네요 ㅋ
감사합니다!!! ^^
from smarteditor2.
Related Issues (20)
- 내부태그 적용 안됨 HOT 1
- 네이버 입력창 contents 내용에 따라 높이(height)를 동적 조절할 수 있는 방법 있나요?
- 스마트에디터 html 부분에 스크립트 추가
- 스마트에디터 ONE 이나 3.0 버전은 외부사이트에서 사용할 수 없나요? HOT 2
- 특정 웹 영문 폰트가 SmartEditor2 에서 font-family 에 quot; 치환되는 문제발생
- 멀티 이미지 업로드 오류 HOT 3
- textarea 내용 수정 문의 HOT 1
- 편집모드 컨트롤
- 에디터2.0 사진붙여넣기
- 네이버 스마트 에디터 2.0 이미지를 base64로 변환하여 에디터로 넣을수있나요?
- 네이버 스마트에디터 수정 시 내용을 불러오지 못함
- 스마트에디터 2.0 폐쇄망 환경 사용 문의
- react 지원여부 궁굼합니다
- 기본 글꼴 설정 관련 문의입니다.
- smarteditor2.min.js 문의
- 폰트 저작권 HOT 1
- smarteditor2 표 위치 조정 문의
- 이미지 업로드시 오류
- 이미지 퀵 업로드 시 403에러
- 스마트에디터 붙여넣기 막기 및 이미지 용량 제한
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smarteditor2.