6

我有以下tinymce的配置。我想在单独的选项卡或窗口中打开超链接单击的结果。我theme_advanced_link_targets : "_blank"如下所示使用但没有帮助。有没有其他的配置参数呢?

  var tinyMCESettings = {
    theme : "advanced",
    plugins : "preview",
    readonly : readOnly,
    theme_advanced_buttons1 : "forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull",
    width : width,
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "false",
    theme_advanced_link_targets : "_blank",
    forced_root_block : false,
    relative_urls : false,
    remove_script_host : false
  }
4

2 回答 2

13

对于 TinyMCE 4.0.23,您可以使用(未​​记录的)选项:

default_link_target:"_blank"

原样:

tinymce.init({
    selector: "textarea.rta",
    auto_focus: rta_auto_focus,
    forced_root_block : false,
    statusbar:  false,
    menubar:    false,
    content_css : "content.min.css",
    plugins: [
        "autolink lists link autoresize",
        "searchreplace code",
        "paste"
    ],
    default_link_target:"_blank",
    toolbar: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link"
});
于 2014-11-28T07:07:01.563 回答
8

用参数解决了

    extended_valid_elements : "a[href|target=_blank]"
于 2013-09-20T04:15:35.527 回答