callBehavior('ckeditorExtraPlugins',$__extraPlugins); $extraPlugins = $__extraPlugins->getArrayCopy(); ?> (function($) { $.toolbarPopup = function toolbarPopup(url) { var popup_params = 'alwaysRaised=yes,dependent=yes,toolbar=yes,'; popup_params += 'height=420,width=520,menubar=no,resizable=yes,scrollbars=yes,status=no'; var popup_link = window.open(url,'dc_popup', popup_params); }; $.stripBaseURL = function stripBaseURL(url) { if (dotclear.base_url != '') { var pos = url.indexOf(dotclear.base_url); if (pos == 0) { url = url.substr(dotclear.base_url.length); } } return url; }; /* Retrieve editor name from URL */ $.getEditorName = function getEditorName(url) { return url.replace(/.*editor=([^&]*)(&.*)?/,'$1'); } })(jQuery); $(function() { /* By default ckeditor load related resources with a timestamp to avoid cache problem when upgrading itself * load_plugin_file.php does not allow other param that file to load (pf param), so remove timestamp */ CKEDITOR.timestamp = ''; CKEDITOR.config.skin = 'dotclear,'+dotclear.dcckeditor_plugin_url+'/js/ckeditor-skins/dotclear/'; CKEDITOR.config.toolbarCanCollapse = true; CKEDITOR.plugins.addExternal('entrylink',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/entrylink/'); CKEDITOR.plugins.addExternal('dclink',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/dclink/'); CKEDITOR.plugins.addExternal('media',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/media/'); 0) { foreach ($extraPlugins as $plugin) { printf("\tCKEDITOR.plugins.addExternal('%s','%s');\n", $plugin['name'], $plugin['url']); } } ?> $('').ckeditor({ 0) { foreach ($extraPlugins as $plugin) { $defautExtraPlugins .= ','. $plugin['name']; } } ?> extraPlugins: '', // format tags format_tags: 'p;h1;h2;h3;h4;h5;h6;pre;address', // following definition are needed to be specialized format_p: { element: 'p' }, format_h1: { element: 'h1' }, format_h2: { element: 'h2' }, format_h3: { element: 'h3' }, format_h4: { element: 'h4' }, format_h5: { element: 'h5' }, format_h6: { element: 'h6' }, format_pre: { element: 'pre' }, format_address: { element: 'address' }, entities: false, removeButtons: '', allowedContent: true, toolbar: [ { name: 'basicstyles', items: [ 'Format', 'Bold','Italic','Underline','Strike','Subscript','Superscript','Code','Blockquote', 'NumberedList', 'BulletedList', 'RemoveFormat' ] }, { name: 'clipoard', items: ['Cut','Copy','Paste','PasteText','PasteFromWord'] }, { name: 'paragraph', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] }, { name: 'table', items: ['Table'] }, { name: 'custom', items: [ 'EntryLink','dcLink','Media','-', 'Source', 'Maximize' ,'TextColor' ] }, 0) { $extraPlugins_str = "{name: 'extra', items: [%s]},\n"; $extra_icons = ''; foreach ($extraPlugins as $plugin) { $extra_icons .= sprintf("'%s',", $plugin['button']); } printf($extraPlugins_str, $extra_icons); } ?> ] }); CKEDITOR.on('instanceReady', function(e) { if ($('label[for="post_excerpt"] a img').attr('src')==dotclear.img_minus_src) { $('#cke_post_excerpt').removeClass('hide'); } else { $('#cke_post_excerpt').addClass('hide'); } $('#excerpt-area label').click(function() { $('#cke_post_excerpt').toggleClass('hide',$('#post_excerpt').hasClass('hide')); }); }); });