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

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

팁앤테크

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

페이지 정보

profile_image
작성자 제로
댓글 0건 조회 47,891회 작성일 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 779건 19 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 날짜
329 제로 103859 03-20
328 제로 98557 03-20
327 제로 90339 03-20
326 제로 90470 03-20
325 제로 98542 03-20
324 제로 45138 03-17
323 제로 47493 03-13
열람중 제로 47892 03-13
321 제로 45971 03-08
320 제로 44990 03-08
319 제로 71096 03-06
318 제로 54739 03-05
317 제로 43885 03-05
316 제로 37645 03-02
315 제로 37537 02-25
314 제로 47600 02-25
313 제로 87108 02-17
312 제로 43938 02-13
311 제로 54191 01-28
310 제로 83973 01-26
309 제로 97441 01-24
308 제로 40578 01-23
307 제로 49797 01-21
306 제로 55311 01-20
305 제로 128930 01-20

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

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