/** * @license Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.timestamp = 202009241025; CKEDITOR.config.enterMode = CKEDITOR.ENTER_P; $(function() { if ($('#afwmailerbody').length) { // Newsletter, allow html and doctype tags CKEDITOR.config.fullPage = true; } }); CKEDITOR.on('dialogDefinition', function(ev) { try { var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if ( dialogName == 'link' ) { var infoTab = dialogDefinition.getContents( 'info' ); var protoField = infoTab.get( 'protocol' ); console.log(protoField.items); addarr = ["tel:", "tel:"]; protoField.items.push(addarr); } } catch(exception) { console.log('Error ' + exception.message); } }); CKEDITOR.config.resize_dir = 'both'; //langrenn.com CKEDITOR.config.allowedContent = true; CKEDITOR.config.pasteFromWordRemoveFontStyles = true; // false; CKEDITOR.config.pasteFromWordRemoveStyles = true; // false; // CKEDITOR.config.pasteFilter = 'semantic-content'; //config.extraPlugins = 'cplugin'; //config.customConfig = "../myconfig.js"; //ingress var ckeditor_ingress_toolbar = [ // { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] }, { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: ['Bold', 'Italic', 'Underline', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, /* { name: 'justify', groups: ['justify'], items: ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'] }, */ { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor', 'PageLink', 'ArticleLink', 'FileLink', 'ImageTag', 'ImageMaps', 'CP_IMAGE', 'CP_FILEBROWSER', 'CP_LINKFILE', 'CP_LINKARTICLE', 'CP_LINKPAGE', 'CP_LINKSLIDE', '-', 'CP_LINKWEB', 'CP_LINKMAIL' ] }, { name: 'styles', items: [ 'Styles', 'Format', 'FontSize' , 'TextColor', 'BGColor' ] }, { name: 'insert', items: [ 'SpecialChar' , 'Source'] } /*{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar' ] },*/ /* { name: 'insert', items: [ 'Table', 'HorizontalRule', 'SpecialChar' , 'Source'] },*/ /* { name: 'other', items: [ 'A11ychecker' ] }*/ /*{ name: 'about', items: [ 'About' ] }*/ /* LEGG TIL: bilde, link til fil, link til artikkel, link til side, Fikse WAI Head table */ ]; var ckeditor_ingress_toolbar_inline = [ { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: ['Bold', 'Italic', 'Underline', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor', 'PageLink', 'ArticleLink', 'FileLink', 'ImageTag', 'ImageMaps', 'CP_IMAGE', 'CP_FILEBROWSER', 'CP_LINKFILE', 'CP_LINKARTICLE', 'CP_LINKPAGE', 'CP_LINKSLIDE', '-', 'CP_LINKWEB', 'CP_LINKMAIL' ] }, { name: 'styles', items: [ 'Styles', 'Format', 'FontSize' , 'TextColor', 'BGColor' ] }, { name: 'insert', items: [ 'SpecialChar' , 'Source'] } ]; //mini / basic var ckeditor_mini_toolbar = [ // { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] }, { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, { name: 'justify', groups: ['justify'], items: ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor', 'PageLink', 'ArticleLink', 'FileLink', 'ImageTag', 'ImageMaps', 'CP_IMAGE', 'CP_FILEBROWSER', 'CP_LINKFILE', 'CP_LINKARTICLE', 'CP_LINKPAGE', 'CP_LINKSLIDE', '-', 'CP_LINKWEB', 'CP_LINKMAIL' ] }, { name: 'styles', items: [ 'Styles', 'Format', 'FontSize' , 'TextColor', 'BGColor' ] }, /*{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar' ] },*/ { name: 'insert', items: [ 'Table', 'HorizontalRule', 'SpecialChar' , 'Source'] }, /* { name: 'other', items: [ 'A11ychecker' ] }*/ /*{ name: 'about', items: [ 'About' ] }*/ /* LEGG TIL: bilde, link til fil, link til artikkel, link til side, Fikse WAI Head table */ ]; //full var ckeditor_standard_toolbar = [ // { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] }, { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, { name: 'justify', groups: ['justify'], items: ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-' ] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor', 'PageLink', 'ArticleLink', 'FileLink', 'ImageTag','ImageMaps' ]/* LEGG TIL BILDEPLUKK ETC */ /*,'Anchor'*/ }, { name: 'insert', items: [ 'Flash'/*LEGG STOETTE FOR DENNE*/, 'Table', 'HorizontalRule', 'SpecialChar' ] }, { name: 'styles', items: [ 'Styles', 'Format', 'FontSize', 'TextColor','BGColor' ] }, { name: 'tools', items: [ 'Maximize','Source'/*,'Image'*/ ] }, { name: 'others', items: [ '-' ] }, { name: 'other', items: [ 'A11ychecker' ] }, { name: 'about', items: [ 'About' ] } /* LEGG TIL: bilde, link til fil, link til artikkel, link til side, Fikse WAI Head table */ ]; // full inline var ckeditor_standard_toolbar_inline = [ // { name: 'links', items: [ 'Link', 'Unlink', 'Anchor', 'PageLink', 'ArticleLink', 'FileLink', 'ImageTag','ImageMaps' ]/* LEGG TIL BILDEPLUKK ETC */ /*,'Anchor'*/ }, { name: 'document', items: [ 'Source' ] }, { name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, { name: 'editing', items: [ 'Find', 'Replace' ] }, { name: 'forms', items: [ 'Button' ] }, { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] }, '/', { name: 'links', items: [ 'Link', 'Unlink', 'Anchor', 'PageLink', 'ArticleLink', 'FileLink', 'ImageTag','ImageMaps' ] }, { name: 'insert', items: [ 'Table', 'HorizontalRule', 'SpecialChar', 'Iframe' ] }, { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] }, { name: 'colors', items: [ 'TextColor', 'BGColor' ] }, { name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] }, { name: 'other', items: [ 'A11ychecker', 'Sourcedialog' ] } ]; // Remove some buttons, provided by the standard plugins, which we don't // need to have in the Standard(s) toolbar. //config.removeButtons = 'Underline,Subscript,Superscript'; function removeCkEditor(jqueryfilter) { jQuery(jqueryfilter).each(function(i){ if (CKEDITOR.instances[this.id]) { CKEDITOR.remove(CKEDITOR.instances[this.id]); // .destroy(); } }); return false; } function addCkEditorMagic(jqueryfilter) { if (jQuery(jqueryfilter).hasClass('ckeditoringress')) { addCkEditorIngress(jqueryfilter); } else if (jQuery(jqueryfilter).hasClass('ckeditorbasic')) { addCkEditorMini(jqueryfilter); } else if (jQuery(jqueryfilter).hasClass('ckeditorbasic')) { addCkEditorMagic(jqueryfilter); } else { addCkEditorFull(jqueryfilter); } } function addCkEditorIngress(jqueryfilter) { return addCkEditor(jqueryfilter, ckeditor_ingress_toolbar, '120px'); } function addCkEditorMini(jqueryfilter) { return addCkEditor(jqueryfilter, ckeditor_mini_toolbar, '100px'); } function addCkEditorParagraph(jqueryfilter) { return addCkEditor(jqueryfilter, ckeditor_standard_toolbar, '100px'); } function addCkEditorFull(jqueryfilter) { return addCkEditor(jqueryfilter, ckeditor_standard_toolbar, '300px'); } function addCkEditorInline(jqueryfilter) { return addCkEditor(jqueryfilter, ckeditor_mini_toolbar, '120px', true); } function addCkEditorInlineIngress(jqueryfilter) { return addCkEditor(jqueryfilter, ckeditor_ingress_toolbar_inline, '120px', true); } function addCkEditorInlineFull(jqueryfilter) { return addCkEditor(jqueryfilter, ckeditor_standard_toolbar_inline, '300px', true); } function addCkEditor(jqueryfilter, toolbar, height) { var inline = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; // IE 11 jQuery(jqueryfilter).each(function(i){ if (!jQuery(this).hasClass('hasCkEditor')) { jQuery(this).addClass('hasCkEditor'); ckedit_editorid = jQuery(this).attr('id'); //console.log("ckedit_editorid="+ckedit_editorid); if (CKEDITOR.instances[ckedit_editorid]) { CKEDITOR.remove(CKEDITOR.instances[ckedit_editorid]); // .destroy(); } // language var lnlang = 'en'; if (jQuery('body').hasClass('langno')) lnlang = 'no'; if (jQuery('body').hasClass('langnn')) lnlang = 'no'; if (jQuery('body').hasClass('langnl')) lnlang = 'nl'; if (jQuery('body').hasClass('langsv')) lnlang = 'sv'; // console.log('language='+lnlang); // console.log('ckedit_editorid='+ckedit_editorid); var extraplugins = 'a11ychecker,balloonpanel,imagemaps,cppagelink,cparticlelink,cpfilelink,cpimgtag'; if (inline) extraplugins+=',autogrow,sourcedialog'; params = { // extraPlugins : 'cpimagemaps,cppagelink,cparticlelink,cpfilelink,cpimgtag', extraPlugins : extraplugins, toolbar : toolbar, language : lnlang, defaultLanguage : lnlang, // filebrowserBrowseUrl : '/admin/ckeditor/filebrowser.php?&mode=picker', // filebrowserUploadUrl : '/admin/ckeditor/quickupload.php?&mode=picker', // filebrowserImageBrowseUrl : '/admin/ckeditor/filebrowser.php?filter=image&mode=picker', // filebrowserImageUploadUrl : '/admin/ckeditor/quickupload.php?filter=image&mode=picker', // filebrowserWindowWidth : 800, // filebrowserWindowHeight : 400, pasteFilter: 'semantic-content', height : height, skin: 'moono-lisa', // skin : 'moonocolor', //startupMode : 'source'; // set the startup mode CKEDITOR.config.startupMode = 'source'; a11ychecker_quailParams: { jsonPath: '/cpclass/js/ckeditor-4.4.7/plugins/a11ychecker/libs/quail', // Override Accessibility Checker guidelines from the default configuration. guideline: ['imgNonDecorativeHasAlt','imgImportantNoSpacerAlt','aTitleDescribesDestination','aAdjacentWithSameResourceShouldBeCombined','aImgAltNotRepetitive','aMustNotHaveJavascriptHref','aSuspiciousLinkText','blockquoteNotUsedForIndentation','documentVisualListsAreMarkedUp','headerH1','headerH2','headerH3','headerH4','imgAltIsDifferent','imgAltIsTooLong','imgAltNotEmptyInAnchor','imgAltTextNotRedundant','imgHasAlt','imgShouldNotHaveTitle','linkHasAUniqueContext','pNotUsedAsHeader','tableDataShouldHaveTh','imgWithEmptyAlt'] }, }; if (jQuery(this).hasClass('ckeditorinheritsize')) { // Se f.eks kondis. params.width = jQuery(this).width(); } if (!inline) { CKEDITOR.replace(ckedit_editorid, params ); } else { CKEDITOR.inline(ckedit_editorid, params ); } } // has hasCkEditor class }); return false; }