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

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

팁앤테크

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

페이지 정보

profile_image
작성자 제로
댓글 0건 조회 48,704회 작성일 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건 19 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 날짜
379 제로 50579 04-30
378 제로 91654 04-20
377 제로 104663 04-10
376 제로 63088 03-27
375 제로 44648 03-25
374 제로 47456 03-25
373 제로 57438 03-25
372 제로 48320 03-23
371 제로 106161 03-20
370 제로 100230 03-20
369 제로 91699 03-20
368 제로 91792 03-20
367 제로 100331 03-20
366 제로 45858 03-17
365 제로 48213 03-13
열람중 제로 48705 03-13
363 제로 46835 03-08
362 제로 45758 03-08
361 제로 72436 03-06
360 제로 55861 03-05
359 제로 44597 03-05
358 제로 38285 03-02
357 제로 38112 02-25
356 제로 48387 02-25
355 제로 88864 02-17

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

오늘
3,572
어제
47,624
최대
431,155
전체
7,326,989
Copyright (c) 株式会社YHPLUS. All rights reserved.