0

EDITAREA Web ハイライターからこのコード フラグメントを取得しました。コード出力の動作を損なうことなく、読みやすくするためにどのように書き直すことができますか?

editAreaLoader.iframe_script= "<script type='text/javascript'> Ã EA(){vart=Á;t.error=Ì;t.inlinePopup=[{popup_id:\"area_search_replace\",icon_id:\"search\"},{popup_id:\"edit_area_help\",icon_id:\"help\"}];t.plugins={};t.line_number=0;È.eAL.set_browser_infos(t);if(t.isIE >=8)t.isIE=7;t.É={};t.last_text_to_highlight=\"\";t.last_hightlighted_text=\"\";t.syntax_list=[];t.allready_used_syntax={};t.check_line_selection_timer=50;t.ÂFocused=Ì;t.highlight_selection_line=null; text=text.replace(sy[\"custom_regexp\"]['after'][i]['regexp'],convert);}}return text;};var editArea= eA;EditArea=EA;</script>".replace(/Á/g,'this').replace(/Â/g,'textarea').replace(/Ã/g,'function').replace(/Ä/g,'prototype').replace(/Å/g,'settings').replace(/Æ/g,'length').replace(/Ç/g,'style').replace(/È/g,'parent').replace(/É/g,'last_selection').replace(/Ê/g,'value').replace(/Ë/g,'true').replace(/Ì/g,'false');

より読みやすくなるようにコードを書き直す方法は? ありがとう。

4

2 に答える 2

1

コードは次のように展開されます。

関数EA(){
    vart = this;
    t.error = false;
    t.inlinePopup = [{
        popup_id: "area_search_replace"、
        icon_id:"検索"
    }、{
        popup_id: "edit_area_help"、
        icon_id:"ヘルプ"
    }];
    t.plugins = {};
    t.line_number = 0;
    parent.eAL.set_browser_infos(t);
    if(t.isIE> = 8)t.isIE = 7;
    t.last_selection = {};
    t.last_text_to_highlight = "";
    t.last_hightlighted_text = "";
    t.syntax_list = [];
    t.allready_used_syntax = {};
    t.check_line_selection_timer = 50;
    t.textareaFocused = false;
    t.highlight_selection_line = null;
    text = text.replace(sy ["custom_regexp"] ['after'] [i] ['regexp']、convert);
}
}
テキストを返す;
};
var editArea = eA;
EditArea = EA;

ただし、構文エラーがあるため、まったく機能しません。

于 2013-02-11T10:00:06.067 に答える