CKEditor - 复制并粘贴链接即11

时间:2016-02-18 14:20:56

标签: internet-explorer ckeditor

我遇到了CKEditor和IE 11的问题。在CKEditor中我写了一个链接,我定义了一个没有下划线的样式。但是当我将它粘贴到IE 11中时,链接是下划线,在源代码中,链接更新为下划线应用程序。

我做了一些研究,但我不知道它是否是CKEditor的错误或配置文件中缺少的一行。

谢谢,

编辑: 对不起,如果我的英语不完美......

我的CKEditor已集成在Java Liferay Portal中。 CkEditor的版本是4.0.3 在某些形式的门户中,CKEditor是集成的。当我在CKEditor的经典编辑版本中使用它时,我插入一个链接按钮的链接。然后我复制并粘贴它(ctrl + c - ctrl + v),我的第二个链接是下划线。 我尝试使用像Firefox或Chrome这样的好浏览器,但它的工作方式,链接的样式没有更新。

这是我的CKEditor的配置:

var config = ckEditor.config;

config.autoParagraph = false;

config.autoSaveTimeout = 3000;

config.bodyClass = 'html-editor <%= HtmlUtil.escapeJS(colorSchemeCssClass) %> <%= HtmlUtil.escapeJS(cssClasses) %>';

config.closeNoticeTimeout = 8000;

config.contentsCss = ['<%= HtmlUtil.escapeJS(cssPath) %>/aui.css', '<%= HtmlUtil.escapeJS(cssPath) %>/main.css'];

config.startupOutlineBlocks = true;
config.contentsLangDirection = '<%= HtmlUtil.escapeJS(contentsLanguageDir) %>';

config.contentsLanguage = '<%= HtmlUtil.escapeJS(contentsLanguageId.replace("iw_", "he_")) %>';

config.entities = false;

config.extraPlugins = 'a11yhelpbtn,media,scayt,wsc';

config.allowedContent = true;

<c:if test="<%= inlineEdit %>">
    config.extraPlugins += ',ajaxsave,restore';
</c:if>

config.height = 265;

config.language = '<%= HtmlUtil.escapeJS(languageId.replace("iw_", "he_")) %>';

config.pasteFromWordRemoveFontStyles = true;

config.pasteFromWordRemoveStyles = true;

config.resize_enabled = <%= resizable %>;

<c:if test="<%= resizable %>">
    config.resize_dir = 'vertical';
</c:if>

config.stylesCombo_stylesSet = 'liferayStyles';

config.title = false;

config.toolbar_coeContributor = [
    ['Styles'],
    ['Bold', 'Italic', 'Underline', 'Strike'],
    ['Subscript', 'Superscript', 'SpecialChar'],
    ['Undo', 'Redo','RemoveFormat'],
    ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'],
    ['Maximize']
];

config.toolbar_editInPlace = [
    ['Styles'],
    ['Bold', 'Italic', 'Underline', 'Strike'],
    ['Subscript', 'Superscript', 'SpecialChar'],
    ['Undo', 'Redo'],
    ['SpellChecker', 'Scayt'],
    <c:if test="<%= showSource %>">
    ['Source'],
    </c:if>
    ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'], ['RemoveFormat'],['Maximize'],
    ['A11YBtn']
];

config.toolbar_email = [
    [ 'TextColor', 'BGColor', '-', 'Bold', 'Italic', 'Underline', 'Strike'],
    ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
    ['SpellChecker', 'Scayt'],
    '/',
    ['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'SelectAll', 'RemoveFormat'],

    <c:if test="<%= showSource %>">
    ['Source'],
    </c:if>
    ['Link', 'Unlink'],
    ['Image'],['Maximize'],
    ['A11YBtn']
];



config.toolbar_liferay = [
    ['Styles', '-', 'TextColor', 'BGColor'],
    ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
    ['Bold', 'Italic', 'Underline', 'Strike'],      
    <c:if test="<%= inlineEdit %>">
        ['AjaxSave', '-', 'Restore'],
    </c:if>
    ['Subscript', 'Superscript'],
    '/',
    ['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'SelectAll', 'RemoveFormat'],
    ['Find', 'Replace', 'SpellChecker', 'Scayt'],
    ['NumberedList','BulletedList','-','Outdent','Indent','HorizontalRule','Blockquote','CreateDiv','IconsCoe'],
    '/',

    <c:if test="<%= !inlineEdit && showSource %>">
        ['Source'],     
    </c:if>
    ['Link', 'Unlink', 'Anchor','LinkCoE','IconsCoe','FlagsCoe'],
    ['Image', 'Flash', <c:if test="<%= XugglerUtil.isEnabled() %>">'Audio', 'Video',</c:if> 'Videoloader', 'Table', '-', 'SpecialChar'],
    ['ShowBlocks'],['Maximize'],
    ['A11YBtn']
];

config.toolbar_liferayArticle = [
    ['Styles', '-', 'TextColor', 'BGColor'],
    ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
    ['Bold', 'Italic', 'Underline', 'Strike'],      
    <c:if test="<%= inlineEdit %>">
        ['AjaxSave', '-', 'Restore'],
    </c:if>
    ['Subscript', 'Superscript'],
    ['Maximize'],
    '/',
    ['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'SelectAll', 'RemoveFormat'],
    ['Find', 'Replace', 'SpellChecker', 'Scayt'],
    ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','HorizontalRule','CreateDiv'],
    '/',

    <c:if test="<%= !inlineEdit && showSource %>">
    ['Source'],
    </c:if>
    ['Link', 'Unlink', 'Anchor','LinkCoE','IconsCoe','FlagsCoe'],
    ['Image', 'Flash', <c:if test="<%= XugglerUtil.isEnabled() %>">'Audio', 'Video',</c:if> 'Videoloader', 'Table', '-', 'SpecialChar'],
    ['ShowBlocks'],['Maximize'],
    ['A11YBtn']
];

config.toolbar_phone = [
    ['Bold', 'Italic', 'Underline'],
    ['NumberedList', 'BulletedList'],
    ['Image', 'Link', 'Unlink'],['Maximize']
];

config.toolbar_simple = [
    ['Bold', 'Italic', 'Underline', 'Strike'],
    ['NumberedList', 'BulletedList'],
    ['Image', 'Link', 'Unlink', 'Table'],['Maximize']
];

config.extraPlugins = 'link_coe,videoloader,icons_coe';

config.toolbar_tablet = [
    ['Bold', 'Italic', 'Underline', 'Strike'],
    ['NumberedList', 'BulletedList'],
    ['Image', 'Link', 'Unlink'],
    ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
    ['Styles', 'FontSize'],['Maximize']
];

CKEDITOR.on(
    'dialogDefinition',
    function(event) {
        var dialogDefinition = event.data.definition;

        var onShow = dialogDefinition.onShow;

        dialogDefinition.onShow = function() {
            if (typeof onShow === 'function') {
                onShow.apply(this, arguments);
            }

            if (window.top != window.self) {
                var editorElement = this.getParentEditor().container;

                var documentPosition = editorElement.getDocumentPosition();

                var dialogSize = this.getSize();

                var x = documentPosition.x + ((editorElement.getSize('width', true) - dialogSize.width) / 2);
                var y = documentPosition.y + ((editorElement.getSize('height', true) - dialogSize.height) / 2);

                this.move(x, y, false);
            }
        }
    }
);

0 个答案:

没有答案