Changeset 2751:a96ec5640056 for plugins/dcLegacyEditor/js/_post_editor.js
- Timestamp:
- 09/09/14 16:30:31 (11 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.