[제나플러스] geditor 에서 링크 넣을때 http,ftp,mailto사용하지 않기 > 팁앤테크

본문 바로가기
사이트 내 전체검색

팁앤테크

[제나플러스] geditor 에서 링크 넣을때 http,ftp,mailto사용하지 않기

페이지 정보

본문

링크넣기 코드를 수정했습니다.

3693754402_ba85489e_20100313152938_03.gif

중간 셀렉트 에서 주소를 http,ftp,mailto를 사용하지만 사용상 더 불편한점이 더 많아서 이부분을 처리하였습니다.

3693754402_5055640f_20100313152938_07.gif

geditor/geditor.js

this.insert_link = function(obj) {

    this.clear_option();
    this.get_range();

    var self = this;

    var div = this.get_option_div(obj, 100);
    div.id = "geditor_option_div";

    var info = document.createElement("div");
    info.style.fontSize = '12px';
    info.innerHTML = '<b>링크 넣기</b>';

    var select = document.createElement("select");

    var option = document.createElement("option");
    option.value = '_blank';
    option.innerHTML = '새창';
    select.appendChild(option);

    var option = document.createElement("option");
    option.value = '_self';
    option.innerHTML = '현재창';
    select.appendChild(option);

//    var protocol = document.createElement("select");
/*
    var protocol_list = ['http://', 'ftp://', 'mailto:']
    for (i=0; i<protocol_list.length; i++) {
        var option = document.createElement("option");
        option.value = protocol_list[i];
        option.innerHTML = protocol_list[i];
        protocol.appendChild(option);
    }
*/
    var input = document.createElement("input");
    input.size = 20;
    input.type = _TEXT;

    var submit = this.button('확인');
    submit.onclick = function() {
        //self.insert_editor("<a href=\"" + protocol.value + input.value + "\" target=\"" + select.value + "\">", "</a>");
        self.insert_editor("<a href=\"" + input.value + "\" target=\"" + select.value + "\">", "</a>");
    }

    var close = this.button('닫기');
    close.onclick  = function() { self.clear_option(); }

    div.appendChild(info);
    div.appendChild(select);
   // div.appendChild(protocol);
    div.appendChild(input);
    div.appendChild(submit);
    div.appendChild(close);
    document.body.appendChild(div);
}
추천0

댓글목록

등록된 댓글이 없습니다.

Total 4건 1 페이지
  • RSS

검색

회원로그인

회원가입

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒140-0011 東京都品川区東大井2-5-9-203
050-5539-7787
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

접속자집계

오늘
363
어제
5,850
최대
7,259
전체
1,211,315
Copyright (c) 株式会社YHPLUS. All rights reserved.