Git Product home page Git Product logo

Comments (3)

imredcat avatar imredcat commented on July 22, 2024 1

저도 그부분을 찾고 있었는데요.
제가 구현한 부분의 흐름은...
업로드된 이미지 목록과 본문내의 이미지를 매칭시킬 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.

imredcat avatar imredcat commented on July 22, 2024 1

그리고...
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.

JinSeok-Ryu avatar JinSeok-Ryu commented on July 22, 2024

으 말씀하신 내용을 못보고 indexOf 를 이용해서 해결했습니다.
말씀하신 deltInnerImg 펑션을 보니 전 왜 저런생각을 못했을까 싶네요 ㅋ
감사합니다!!! ^^

from smarteditor2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.