Changeset 307:e637c27e4935 for admin
- Timestamp:
- 05/23/11 13:46:19 (14 years ago)
- Branch:
- wysiwyg
- Location:
- admin/js
- Files:
-
- 83 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_post.js
r0 r307 80 80 var formatField = $('#post_format').get(0); 81 81 $(formatField).change(function() { 82 excerptTb.switchMode(this.value); 83 contentTb.switchMode(this.value); 84 }); 85 86 var excerptTb = new jsToolBar(document.getElementById('post_excerpt')); 87 var contentTb = new jsToolBar(document.getElementById('post_content')); 88 excerptTb.context = contentTb.context = 'post'; 82 $('#post_excerpt').dctoolbarmanager('switch',$(this).val()); 83 $('#post_content').dctoolbarmanager('switch',$(this).val()); 84 }); 85 86 // Init toolbars 87 $('#post_excerpt,#post_content').dctoolbarmanager({mode:$(formatField).val()}); 89 88 } 90 89 91 90 if (document.getElementById('comment_content')) { 92 var commentTb = new jsToolBar(document.getElementById('comment_content'));91 $('#comment_content').dctoolbarmanager({mode:'xhtml'}); 93 92 } 94 93 … … 97 96 98 97 // Tabs events 99 $('#edit-entry').onetabload(function() { 98 $('#edit-entry').onetabload(function() { 100 99 dotclear.hideLockable(); 101 100 … … 123 122 }); 124 123 124 $('#post_content').dctoolbarmanager('draw'); 125 125 126 // We load toolbar on excerpt only when it's ready 126 127 $('#excerpt-area label').toggleWithLegend($('#excerpt-area').children().not('label'),{ 127 fn: function() { excerptTb.switchMode(formatField.value); },128 fn: function() { $('#post_excerpt').dctoolbarmanager('draw'); }, 128 129 cookie: 'dcx_post_excerpt', 129 130 hide: $('#post_excerpt').val() == '' 130 131 }); 131 132 // Load toolbars133 contentTb.switchMode(formatField.value);134 132 135 133 // Replace attachment remove links by a POST form submit … … 227 225 228 226 $('#add-comment').onetabload(function() { 229 commentTb.draw('xhtml');227 $('#comment_content').dctoolbarmanager('draw'); 230 228 }); 231 229 }); -
admin/js/jsToolBar/jsToolBar.js
r0 r307 159 159 }, 160 160 161 remove: function() { 162 // Empty toolbar 163 while (this.toolbar.hasChildNodes()) { 164 this.toolbar.removeChild(this.toolbar.firstChild) 165 } 166 this.toolbar.parentNode.appendChild(this.textarea); 167 this.toolbar.parentNode.removeChild(this.handle); 168 this.toolbar.parentNode.removeChild(this.editor); 169 this.toolbar.parentNode.removeChild(this.toolbar); 170 this.toolNodes = {}; // vide les raccourcis DOM/**/ 171 }, 172 161 173 button: function(toolName) { 162 174 var tool = this.elements[toolName];
Note: See TracChangeset
for help on using the changeset viewer.