Changeset 2856:b9ae6bf9bd6e
- Timestamp:
- 12/17/14 11:40:49 (9 years ago)
- Branch:
- 2.7
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_index.js
r2614 r2856 2 2 var f = $('#quick-entry'); 3 3 if (f.length > 0) { 4 if ( $.isFunction('jsToolBar')) {4 if (typeof(jsToolBar)!==undefined) { 5 5 var contentTb = new jsToolBar($('#post_content',f)[0]); 6 6 contentTb.switchMode($('#post_format',f).val()); -
admin/post.php
r2854 r2856 377 377 378 378 $admin_post_behavior = ''; 379 if ($post_editor && !empty($post_editor[$post_format])) { 380 $admin_post_behavior = $core->callBehavior('adminPostEditor', $post_editor[$post_format], 'post', array('#post_excerpt','#post_content,#comment_content')); 379 if ($post_editor) { 380 $p_edit = $c_edit = ''; 381 if (!empty($post_editor[$post_format])) { 382 $p_edit = $post_editor[$post_format]; 383 } 384 if (!empty($post_editor['xhtml'])) { 385 $c_edit = $post_editor['xhtml']; 386 } 387 if ($p_edit == $c_edit) { 388 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 389 $p_edit,'post',array('#post_excerpt','#post_content','#comment_content')); 390 } else { 391 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 392 $p_edit,'post',array('#post_excerpt','#post_content')); 393 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 394 $c_edit,'comment',array('#comment_content')); 395 } 381 396 } 382 397 -
plugins/dcLegacyEditor/inc/dc.legacy.editor.behaviors.php
r2854 r2856 22 22 * @param tags <b>array</b> array of ids to inject editor 23 23 */ 24 24 public static function adminPostEditor($editor='',$context='',array $tags=array()) { 25 25 if (empty($editor) || $editor!='dcLegacyEditor') {return;} 26 27 // context and tags are not used for dcLegacyEditor28 26 29 27 return 30 28 self::jsToolBar(). 31 dcPage::jsLoad(self::$p_url.'/js/_post_editor.js'); 29 dcPage::jsLoad(self::$p_url.'/js/_post_editor.js'). 30 '<script type="text/javascript">'."\n". 31 "//<![CDATA[\n". 32 dcPage::jsVar('dotclear.legacy_editor_context', $context). 33 'dotclear.legacy_editor_tags_context = '.sprintf('{%s:["%s"]};'."\n", $context, implode('","', $tags)). 34 "\n//]]>\n". 35 "</script>\n"; 32 36 } 33 37 … … 57 61 if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) { 58 62 $res .= '<script type="text/javascript" src="'.self::$p_url.'/js/jsToolBar/jsToolBar.wysiwyg.js"></script>'; 59 63 } 60 64 61 65 $res .= -
plugins/dcLegacyEditor/js/_post_editor.js
r2751 r2856 1 1 $(function() { 2 2 if ($('#edit-entry').length==0) {return;} 3 if (dotclear.legacy_editor_context===undefined 4 || dotclear.legacy_editor_tags_context[dotclear.legacy_editor_context]===undefined) { 5 return; 6 } 3 7 4 // Get document format and prepare toolbars 5 var formatField = $('#post_format').get(0); 6 var last_post_format = $(formatField).val(); 7 $(formatField).change(function() { 8 if (this.value!='dcLegacyEditor') { return;} 8 if ((dotclear.legacy_editor_tags_context[dotclear.legacy_editor_context].indexOf('#post_content')!==-1) 9 && (dotclear.legacy_editor_tags_context[dotclear.legacy_editor_context].indexOf('#post_excerpt')!==-1)) { 10 // Get document format and prepare toolbars 11 var formatField = $('#post_format').get(0); 12 var last_post_format = $(formatField).val(); 13 $(formatField).change(function() { 14 if (this.value!='dcLegacyEditor') { return;} 9 15 10 var post_format = this.value;16 var post_format = this.value; 11 17 12 // Confirm post format change13 if (window.confirm(dotclear.msg.confirm_change_post_format_noconvert)) {14 excerptTb.switchMode(post_format);15 contentTb.switchMode(post_format);16 last_post_format = $(this).val();17 } else {18 // Restore last format if change cancelled18 // Confirm post format change 19 if (window.confirm(dotclear.msg.confirm_change_post_format_noconvert)) { 20 excerptTb.switchMode(post_format); 21 contentTb.switchMode(post_format); 22 last_post_format = $(this).val(); 23 } else { 24 // Restore last format if change cancelled 19 25 $(this).val(last_post_format); 20 } 26 } 27 28 $('.format_control > *').addClass('hide'); 29 $('.format_control:not(.control_no_'+post_format+') > *').removeClass('hide'); 30 }); 31 32 var excerptTb = new jsToolBar(document.getElementById('post_excerpt')); 33 var contentTb = new jsToolBar(document.getElementById('post_content')); 34 excerptTb.context = contentTb.context = 'post'; 21 35 22 36 $('.format_control > *').addClass('hide'); 23 $('.format_control:not(.control_no_'+ post_format+') > *').removeClass('hide');24 } );37 $('.format_control:not(.control_no_'+last_post_format+') > *').removeClass('hide'); 38 } 25 39 26 var excerptTb = new jsToolBar(document.getElementById('post_excerpt')); 27 var contentTb = new jsToolBar(document.getElementById('post_content')); 28 excerptTb.context = contentTb.context = 'post'; 29 30 $('.format_control > *').addClass('hide'); 31 $('.format_control:not(.control_no_'+last_post_format+') > *').removeClass('hide'); 32 33 if ($('#comment_content').length>0) { 34 var commentTb = new jsToolBar(document.getElementById('comment_content')); 35 commentTb.draw('xhtml'); 40 if (dotclear.legacy_editor_tags_context[dotclear.legacy_editor_context].indexOf('#comment_content')!==-1) { 41 if ($('#comment_content').length>0) { 42 var commentTb = new jsToolBar(document.getElementById('comment_content')); 43 commentTb.draw('xhtml'); 44 } 36 45 } 37 46 … … 103 112 104 113 // Load toolbars 105 contentTb.switchMode(formatField.value); 106 excerptTb.switchMode(formatField.value); 114 if (contentTb!==undefined && excerptTb!==undefined) { 115 contentTb.switchMode(formatField.value); 116 excerptTb.switchMode(formatField.value); 117 } 107 118 108 119 // Check unsaved changes before XHTML conversion -
plugins/pages/page.php
r2854 r2856 285 285 286 286 $admin_post_behavior = ''; 287 if ($post_editor && !empty($post_editor[$post_format])) { 288 $admin_post_behavior = $core->callBehavior('adminPostEditor', $post_editor[$post_format], 'page', array('#post_excerpt','#post_content')); 287 if ($post_editor) { 288 $p_edit = $c_edit = ''; 289 if (!empty($post_editor[$post_format])) { 290 $p_edit = $post_editor[$post_format]; 291 } 292 if (!empty($post_editor['xhtml'])) { 293 $c_edit = $post_editor['xhtml']; 294 } 295 if ($p_edit == $c_edit) { 296 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 297 $p_edit,'page',array('#post_excerpt','#post_content','#comment_content')); 298 } else { 299 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 300 $p_edit,'page',array('#post_excerpt','#post_content')); 301 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 302 $c_edit,'comment',array('#comment_content')); 303 } 289 304 } 290 305
Note: See TracChangeset
for help on using the changeset viewer.