Changeset 2751:a96ec5640056 for plugins
- Timestamp:
- 09/09/14 16:30:31 (11 years ago)
- Branch:
- default
- Location:
- plugins
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcCKEditor/_post_config.php
r2738 r2751 31 31 } 32 32 } 33 33 34 34 return url; 35 35 }; 36 36 37 /* Retrieve editor name from URL */ 38 $.getEditorName = function getEditorName(url) { 39 return url.replace(/.*editor=([^&]*)(&.*)?/,'$1'); 37 /* Retrieve editor from popup */ 38 $.active_editor = null; 39 $.getEditorName = function getEditorName() { 40 return $.active_editor; 40 41 } 41 42 })(jQuery); … … 49 50 CKEDITOR.config.skin = 'dotclear,'+dotclear.dcckeditor_plugin_url+'/js/ckeditor-skins/dotclear/'; 50 51 51 <?php if (!empty($dcckeditor_cancollapse_button)):?> 52 <?php if (!empty($dcckeditor_cancollapse_button)):?> 52 53 CKEDITOR.config.toolbarCanCollapse = true; 53 54 <?php endif;?> 54 55 CKEDITOR.plugins.addExternal('entrylink',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/entrylink/'); 55 56 CKEDITOR.plugins.addExternal('entrylink',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/entrylink/'); 56 57 CKEDITOR.plugins.addExternal('dclink',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/dclink/'); 57 58 CKEDITOR.plugins.addExternal('media',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/media/'); … … 75 76 extraPlugins: '<?php echo $defautExtraPlugins;?>', 76 77 77 <?php if (!empty($dcckeditor_format_select)):?> 78 <?php if (!empty($dcckeditor_format_select)):?> 78 79 // format tags 79 80 format_tags: 'p;h1;h2;h3;h4;h5;h6;pre;address', … … 102 103 <?php endif;?> 103 104 'Bold','Italic','Underline','Strike','Subscript','Superscript','Code','Blockquote', 104 105 105 106 <?php if (!empty($dcckeditor_list_buttons)):?> 106 107 'NumberedList', 'BulletedList', … … 135 136 ,'TextColor' 136 137 <?php endif;?> 137 ] 138 ] 138 139 }, 139 140 <?php // add extra buttons comming from dotclear plugins … … 156 157 $('#cke_post_excerpt').addClass('hide'); 157 158 } 158 159 159 160 $('#excerpt-area label').click(function() { 160 161 $('#cke_post_excerpt').toggleClass('hide',$('#post_excerpt').hasClass('hide')); 161 162 }); 162 163 }); 164 165 // @TODO: find a better way to retrieve active editor 166 for (var id in CKEDITOR.instances) { 167 CKEDITOR.instances[id].on('focus', function(e) { 168 $.active_editor = e.editor.name; 169 }); 170 } 163 171 }); -
plugins/dcCKEditor/js/ckeditor-plugins/dclink/plugin.js
r2743 r2751 6 6 exec: function(editor) { 7 7 if (editor.getSelection().getNative().toString().replace(/\s*/,'')!='') { 8 $.toolbarPopup('popup_link.php? editor='+editor.name);8 $.toolbarPopup('popup_link.php?plugin_id=dcCKEditor'); 9 9 } 10 10 } … … 26 26 editor.getSelection().selectElement(element); 27 27 28 var popup_url = 'popup_link.php? editor='+editor.name;28 var popup_url = 'popup_link.php?plugin_id=dcCKEditor'; 29 29 if (element.getAttribute('href')) { 30 30 popup_url += '&href='+element.getAttribute('href'); -
plugins/dcCKEditor/js/ckeditor-plugins/entrylink/plugin.js
r2743 r2751 6 6 exec: function(editor) { 7 7 if (editor.getSelection().getNative().toString().replace(/\s*/,'')!='') { 8 $.toolbarPopup('popup_posts.php?popup=1& editor='+editor.name);8 $.toolbarPopup('popup_posts.php?popup=1&plugin_id=dcCKEditor'); 9 9 } 10 10 } … … 18 18 19 19 editor.on('doubleclick',function(e) { 20 var element = CKEDITOR.plugins.link.getSelectedLink( editor) || e.data.element;20 var element = CKEDITOR.plugins.link.getSelectedLink(editor) || e.data.element; 21 21 if (!element.isReadOnly()) { 22 22 if (element.is('a') … … 25 25 editor.getSelection().selectElement(element); 26 26 27 $.toolbarPopup('popup_posts.php?popup=1& editor='+editor.name);27 $.toolbarPopup('popup_posts.php?popup=1&plugin_id=dcCKEditor'); 28 28 return false; 29 29 } -
plugins/dcCKEditor/js/ckeditor-plugins/media/plugin.js
r2743 r2751 5 5 editor.addCommand('mediaCommand', { 6 6 exec: function(editor) { 7 $.toolbarPopup('media.php?popup=1& editor='+editor.name);7 $.toolbarPopup('media.php?popup=1&plugin_id=dcCKEditor'); 8 8 } 9 9 }); … … 19 19 if (!element.isReadOnly()) { 20 20 if (element.is('img') || (element.is('a') && element.hasClass('media-link'))) { 21 $.toolbarPopup('media.php?popup=1& editor='+editor.name);21 $.toolbarPopup('media.php?popup=1&plugin_id=dcCKEditor'); 22 22 return false; 23 23 } -
plugins/dcCKEditor/js/popup_link.js
r2738 r2751 6 6 $('#link-insert-ok').click(function() { 7 7 var insert_form = $('#link-insert-form').get(0); 8 if (insert_form == undefined) { 9 return; 8 if (insert_form == undefined) { 9 return; 10 10 } 11 11 12 var editor_name = window.opener.$.getEditorName( document.location.search),12 var editor_name = window.opener.$.getEditorName(), 13 13 editor = window.opener.CKEDITOR.instances[editor_name], 14 link = '', 14 link = '', 15 15 selected_text = editor.getSelection().getNative().toString(); 16 16 -
plugins/dcCKEditor/js/popup_media.js
r2738 r2751 3 3 window.close(); 4 4 }); 5 5 6 6 $('#media-insert-ok').click(function() { 7 7 var insert_form = $('#media-insert-form').get(0); 8 if (insert_form === undefined) { 9 return; 8 if (insert_form === undefined) { 9 return; 10 10 } 11 11 12 var editor_name = window.opener.$.getEditorName( document.location.search),12 var editor_name = window.opener.$.getEditorName(), 13 13 editor = window.opener.CKEDITOR.instances[editor_name], 14 14 type = insert_form.elements.type.value, … … 47 47 element = window.opener.CKEDITOR.dom.element.createFromHtml(img); 48 48 } 49 49 50 50 editor.insertElement(element); 51 51 } -
plugins/dcCKEditor/js/popup_posts.js
r2738 r2751 6 6 $('#form-entries tr>td.maximal>a').click(function(e) { 7 7 e.preventDefault(); 8 var editor_name = window.opener.$.getEditorName( document.location.search),8 var editor_name = window.opener.$.getEditorName(), 9 9 editor = window.opener.CKEDITOR.instances[editor_name], 10 10 link = '', -
plugins/dcLegacyEditor/js/_post_editor.js
r2705 r2751 1 1 $(function() { 2 2 if ($('#edit-entry').length==0) {return;} 3 4 // remove editor prefix5 var getPostFormat = function getPostFormat(post_format) {6 return post_format.replace(/[^:]*:/,'');7 };8 var getPostEditor = function getPostEditor(post_format) {9 return post_format.replace(/:.*/,'');10 };11 3 12 4 // Get document format and prepare toolbars … … 14 6 var last_post_format = $(formatField).val(); 15 7 $(formatField).change(function() { 16 if ( getPostEditor(this.value)!='dcLegacyEditor') { return;}8 if (this.value!='dcLegacyEditor') { return;} 17 9 18 var post_format = getPostFormat(this.value);10 var post_format = this.value; 19 11 20 12 // Confirm post format change … … 37 29 38 30 $('.format_control > *').addClass('hide'); 39 $('.format_control:not(.control_no_'+ getPostFormat(last_post_format)+') > *').removeClass('hide');31 $('.format_control:not(.control_no_'+last_post_format+') > *').removeClass('hide'); 40 32 41 33 if ($('#comment_content').length>0) { … … 61 53 excerpt: excerpt_content, 62 54 content: post_content, 63 format: getPostFormat($('#post_format').get(0).value),55 format: $('#post_format').get(0).value, 64 56 lang: $('#post_lang').get(0).value 65 57 }; … … 111 103 112 104 // Load toolbars 113 contentTb.switchMode( getPostFormat(formatField.value));114 excerptTb.switchMode( getPostFormat(formatField.value));105 contentTb.switchMode(formatField.value); 106 excerptTb.switchMode(formatField.value); 115 107 116 108 // Check unsaved changes before XHTML conversion -
plugins/dcLegacyEditor/js/jsToolBar/jsToolBar.dotclear.js
r2614 r2751 5 5 jsToolBar.prototype.elements.link.open_url = 'popup_link.php'; 6 6 7 jsToolBar.prototype.elements.link.popup = function 7 jsToolBar.prototype.elements.link.popup = function(args) { 8 8 window.the_toolbar = this; 9 9 args = args || ''; … … 155 155 fn: {}, 156 156 fncall: {}, 157 open_url: 'media.php?popup=1 ',157 open_url: 'media.php?popup=1&plugin_id=dcLegacyEditor', 158 158 data: {}, 159 159 popup: function() { … … 355 355 title: 'Link to an entry', 356 356 fn: {}, 357 open_url: 'popup_posts.php ',357 open_url: 'popup_posts.php?plugin_id=dcLegacyEditor', 358 358 data: {}, 359 359 popup: function() { -
plugins/tags/_admin.php
r2680 r2751 40 40 $core->addBehavior('adminPageHelpBlock', array('tagsBehaviors', 'adminPageHelpBlock')); 41 41 42 $core->addBehavior('ckeditorExtraPlugins', array('tagsBehaviors', 'ckeditorExtraPlugins'));42 //$core->addBehavior('ckeditorExtraPlugins', array('tagsBehaviors', 'ckeditorExtraPlugins')); 43 43 44 44 # BEHAVIORS
Note: See TracChangeset
for help on using the changeset viewer.