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

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

팁앤테크

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

페이지 정보

profile_image
작성자 제로
댓글 0건 조회 47,892회 작성일 10-03-13 02:57

본문

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

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);
}

댓글목록

등록된 댓글이 없습니다.

Total 829건 1 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 날짜
829 제로 265 06-18
828 제로 2998 03-21
827 제로 3415 02-23
826 제로 29986 11-02
825 제로 33246 07-10
824 제로 42509 04-06
823 제로 30977 02-21
822 제로 35831 12-31
821 제로 30088 12-24
820 제로 29937 12-04
819 제로 32532 10-17
818 제로 31404 10-02
817 제로 54832 08-04
816 제로 29852 08-04
815 제로 40195 08-03
814 제로 40520 07-08
813 제로 68962 07-08
812 제로 83041 07-06
811 제로 31215 06-09
810 제로 36683 06-03
809 제로 35058 04-16
808 제로 35631 03-29
807 제로 30146 03-26
806 제로 37266 03-12
805 제로 32218 03-10

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

오늘
5,716
어제
25,212
최대
431,155
전체
6,730,968
Copyright (c) 株式会社YHPLUS. All rights reserved.