CKEDITOR.config.filebrowserImageBrowseUrl = '/admin/moduls/uploads/elfinder/elfinder.php?mode=images'; CKEDITOR.config.filebrowserBrowseUrl = '/admin/moduls/uploads/elfinder/elfinder.php?mode=files'; CKEDITOR.config.webmapBrowseUrl = '/admin/mapaweb.php?ckeditor'; //configuraciĆ³ pasteCustom CKEDITOR.config.pasteCustomNumberedHeadingToList = true; CKEDITOR.on( 'dialogDefinition', function( ev ) { // Take the dialog name and its definition from the event data. var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if ( dialogName == 'link' ) { /*eliminar pestanya*/ dialogDefinition.removeContents( 'target' ); dialogDefinition.removeContents( 'advanced' ); } if ( dialogName == 'image' ) { /*eliminar pestanya*/ dialogDefinition.removeContents( 'Link' ); /*eliminar camps*/ var infoTab = dialogDefinition.getContents( 'info' ); infoTab.remove( 'txtBorder' ); infoTab.remove( 'txtHSpace' ); infoTab.remove( 'txtVSpace' ); infoTab.remove( 'cmbAlign' ); infoTab.remove( 'txtWidth' ); infoTab.remove( 'txtHeight' ); infoTab.remove( 'ratioLock' ); infoTab.remove( 'txtHeight' ); } if ( dialogName == 'table' || dialogName == 'tableProperties' ) { var infoTab = dialogDefinition.getContents( 'info' ); infoTab.remove( 'txtBorder' ); infoTab.remove( 'txtHSpace' ); infoTab.remove( 'txtVSpace' ); infoTab.remove( 'cmbAlign' ); infoTab.remove( 'txtWidth' ); infoTab.remove( 'cmbWidthType' ); infoTab.remove( 'txtHeight' ); infoTab.remove( 'htmlHeightType' ); infoTab.remove( 'txtCellSpace' ); infoTab.remove( 'txtCellPad' ); } }); //plugins personalitzats var basePath = CKEDITOR.basePath; basePath = basePath.substr(0, basePath.indexOf("ckeditor/")); CKEDITOR.plugins.addExternal('antaviana',basePath+'ckeditor_plugins/antaviana/', 'plugin.js'); CKEDITOR.plugins.addExternal('link_webmap',basePath+'ckeditor_plugins/link_webmap/', 'plugin.js'); CKEDITOR.plugins.addExternal('pasteCustom',basePath+'ckeditor_plugins/paste_custom/', 'plugin.js'); CKEDITOR.plugins.addExternal('pujar',basePath+'ckeditor_plugins/pujar/', 'plugin.js'); CKEDITOR.plugins.addExternal('jqueryspellchecker',basePath+'ckeditor_plugins/jqueryspellchecker/', 'plugin.js'); //CKEDITOR.config.skin = 'BootstrapCK-Skin,'+basePath+'ckeditor_skins/BootstrapCK-Skin/'; CKEDITOR.config.format_tags = 'p;h1;h2;h3;h4'; CKEDITOR.config.defaultLanguage = 'ca'; CKEDITOR.config.entities_latin = false; CKEDITOR.config.contentsCss = '/media/css//editor.css'; CKEDITOR.config.resize_enabled = true; CKEDITOR.config.resize_maxWidth = '775px'; CKEDITOR.config.width ='775px'; CKEDITOR.config.height='200px'; CKEDITOR.config.autoGrow_minHeight = 200; CKEDITOR.config.autoGrow_maxHeight = 500; CKEDITOR.config.toolbar_Full = [ ['Cut','Copy','Paste','-','Undo','Redo'], ['SelectAll','Find','Replace'], ['Bold','Italic','-','RemoveFormat'], ['NumberedList','BulletedList','-','Outdent','Indent',/*'Blockquote', 'CreateDiv'*/], ['Link','Unlink','Anchor'], ['Image','Table','SpecialChar','Pujar'], ['Format','Maximize','ShowBlocks'], ['Source','-','Preview'] ]; CKEDITOR.config.toolbar_Basic = [ ['Cut','Copy','Paste','-','Undo','Redo'], ['Bold','Italic','-','Link','Unlink'], ['Source'] ]; CKEDITOR.config.removePlugins = 'liststyle'; CKEDITOR.config.toolbar_FullSpell = CKEDITOR.config.toolbar_Full; CKEDITOR.config.toolbar_BasicSpell = CKEDITOR.config.toolbar_Basic; CKEDITOR.config.extraPlugins = 'autogrow,antaviana,link_webmap,pasteCustom,pujar'; $(document).ready(function() { $('textarea.editorAll').each(function(index){ var lang = 'ca'; if ($(this).attr('lang')) { lang = $(this).attr('lang'); $(this).ckeditor({ toolbar: 'FullSpell', contentsCss: ['/admin/js/jquery.spellchecker/jquery.spellchecker.min.css', '/media/css//editor.css'], jqueryspellchecker: { lang: lang, webservice: { path: '/admin/php/jqueryspellchecker/SpellChecker.php', driver: 'pspell' } } }); } else { $(this).ckeditor({ toolbar: 'Full' }); } }); $('textarea.editorBasic').each(function(index){ var lang = 'ca'; if ($(this).attr('lang')) { lang = $(this).attr('lang'); $(this).ckeditor({ toolbar: 'BasicSpell', contentsCss: ['/admin/js/jquery.spellchecker/jquery.spellchecker.min.css', '/media/css//editor.css'], jqueryspellchecker: { lang: lang, webservice: { path: '/admin/php/jqueryspellchecker/SpellChecker.php', driver: 'pspell' } } }); } else { $(this).ckeditor({ toolbar: 'Basic' }); } }); });