<commit_before>if (!window.xe) xe = {};

xe.Editors = [];

function editorStart_xe(editor_sequence, primary_key, content_key, editor_height, colorset, content_style, content_font, content_font_size) {
    if(typeof(colorset)=='undefined') colorset = 'white';
    if(typeof(content_style)=='undefined') content_style = 'xeStyle';
    if(typeof(content_font)=='undefined') content_font= '';
    if(typeof(content_font_size)=='undefined') content_font_size= '';

    var target_src = request_uri+'modules/editor/styles/'+content_style+'/editor.html';

    var textarea = jQuery("#xpress-editor-"+editor_sequence);
    var iframe   = jQuery('<iframe id="editor_iframe_'+editor_sequence+'" allowTransparency="true" frameborder="0" src="'+target_src+'" scrolling="yes" style="width:100%;height:'+editor_height+'px">');
    var htmlsrc  = jQuery('<textarea rows="10" cols="20" class="input_syntax '+colorset+'" style="display:none"></textarea>');
    var form     = textarea.get(0).form;
    form.setAttribute('editor_sequence', editor_sequence);
    textarea.css("display","none");

    var saved_content = '';
    if(jQuery("input[name=content]",form).size()>0){
        saved_content=jQuery("input[name=content]",form).val().replace(/src=\"files\/attach/g,'src="'+request_uri+'files/attach'); //'
        jQuery("#xpress-editor-"+editor_sequence).val(saved_content);
    }

    /*
    // remove procFilter
    if(form.comment_srl){
        form.onsubmit=function(){
            var content = editorGetContent(editor_sequence);
            editorRelKeys[editor_sequence]['content'].value = content;
            insert_comment(form);
            return false;
        };
    }else{
        form.onsubmit=function(){
            var content = editorGetContent(editor_sequence);
            editorRelKeys[editor_sequence]['content'].value = content;
            insert(form);
            return false;
        };
    }
    */

    // hide textarea
    textarea.hide().css('width', '99%').before(iframe).after(htmlsrc);

    // create an editor
    var oEditor          = new xe.XpressCore();
    var oWYSIWYGIFrame   = iframe.get(0);
    var oIRTextarea      = textarea.get(0);
    var oHTMLSrcTextarea = htmlsrc.get(0);
    var elAppContainer   = jQuery('.xpress-editor', form).get(0);

    oEditor.getFrame = function(){ return oWYSIWYGIFrame;}
	oEditor.getContent = function(){
		editorGetContentTextarea_xe(editor_sequence);
	}
	
    var content = form[content_key].value;
    if(xFF && !content) content = '<p>&nbsp;</p>';

    // src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경
    content = content.replace(/(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>)*/ig, function(m0,m1,m2,m3,m4,m5) {
        if(m1=="url(") { m2=''; m4=')'; } else { if(typeof(m2)=='undefined') m2 = '"'; if(typeof(m4)=='undefined') m4 = '"'; if(typeof(m5)=='undefined') m5 = ''; }
        var val = jQuery.trim(m3).replace(/^\.\//,'');
        if(/^(http|https|ftp|telnet|mms|\/|\.\.)/i.test(val)) return m0;
        return m1+m2+request_uri+val+m4+m5;
    });

    form[content_key].value = content;
    jQuery("#xpress-editor-"+editor_sequence).val(content);

    // Set standard API
    editorRelKeys[editor_sequence] = new Array();
    editorRelKeys[editor_sequence]["primary"]   = form[primary_key];<commit_msg>#18399347 : FF에서 빈칸(&nbsp;) 대신 빈 줄(<br>)을 기본 컨텐트로 사용<commit_after>if (!window.xe) xe = {};

xe.Editors = [];

function editorStart_xe(editor_sequence, primary_key, content_key, editor_height, colorset, content_style, content_font, content_font_size) {
    if(typeof(colorset)=='undefined') colorset = 'white';
    if(typeof(content_style)=='undefined') content_style = 'xeStyle';
    if(typeof(content_font)=='undefined') content_font= '';
    if(typeof(content_font_size)=='undefined') content_font_size= '';

    var target_src = request_uri+'modules/editor/styles/'+content_style+'/editor.html';

    var textarea = jQuery("#xpress-editor-"+editor_sequence);
    var iframe   = jQuery('<iframe id="editor_iframe_'+editor_sequence+'" allowTransparency="true" frameborder="0" src="'+target_src+'" scrolling="yes" style="width:100%;height:'+editor_height+'px">');
    var htmlsrc  = jQuery('<textarea rows="10" cols="20" class="input_syntax '+colorset+'" style="display:none"></textarea>');
    var form     = textarea.get(0).form;
    form.setAttribute('editor_sequence', editor_sequence);
    textarea.css("display","none");

    var saved_content = '';
    if(jQuery("input[name=content]",form).size()>0){
        saved_content=jQuery("input[name=content]",form).val().replace(/src=\"files\/attach/g,'src="'+request_uri+'files/attach'); //'
        jQuery("#xpress-editor-"+editor_sequence).val(saved_content);
    }

    /*
    // remove procFilter
    if(form.comment_srl){
        form.onsubmit=function(){
            var content = editorGetContent(editor_sequence);
            editorRelKeys[editor_sequence]['content'].value = content;
            insert_comment(form);
            return false;
        };
    }else{
        form.onsubmit=function(){
            var content = editorGetContent(editor_sequence);
            editorRelKeys[editor_sequence]['content'].value = content;
            insert(form);
            return false;
        };
    }
    */

    // hide textarea
    textarea.hide().css('width', '99%').before(iframe).after(htmlsrc);

    // create an editor
    var oEditor          = new xe.XpressCore();
    var oWYSIWYGIFrame   = iframe.get(0);
    var oIRTextarea      = textarea.get(0);
    var oHTMLSrcTextarea = htmlsrc.get(0);
    var elAppContainer   = jQuery('.xpress-editor', form).get(0);

    oEditor.getFrame = function(){ return oWYSIWYGIFrame;}
	oEditor.getContent = function(){
		editorGetContentTextarea_xe(editor_sequence);
	}
	
    var content = form[content_key].value;
    if(xFF && !content) content = '<br />';

    // src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경
    content = content.replace(/(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>)*/ig, function(m0,m1,m2,m3,m4,m5) {
        if(m1=="url(") { m2=''; m4=')'; } else { if(typeof(m2)=='undefined') m2 = '"'; if(typeof(m4)=='undefined') m4 = '"'; if(typeof(m5)=='undefined') m5 = ''; }
        var val = jQuery.trim(m3).replace(/^\.\//,'');
        if(/^(http|https|ftp|telnet|mms|\/|\.\.)/i.test(val)) return m0;
        return m1+m2+request_uri+val+m4+m5;
    });

    form[content_key].value = content;
    jQuery("#xpress-editor-"+editor_sequence).val(content);

    // Set standard API
    editorRelKeys[editor_sequence] = new Array();
    editorRelKeys[editor_sequence]["primary"]   = form[primary_key];
{'fraction_non_alphanumeric': 0.18629227053140096, 'fraction_numerical': 0.012379227053140096, 'mean_word_length': 3.7903109182935646, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1456507', 'n_tokens_mistral': 2267, 'n_tokens_neox': 2207, 'n_words': 325}