Ticket #10185: CKEditorPlaceholderConfigurable.patch
File CKEditorPlaceholderConfigurable.patch, 2.3 KB (added by , 11 years ago) |
---|
-
plugins/placeholder/dialogs/placeholder.js
diff --git a/plugins/placeholder/dialogs/placeholder.js b/plugins/placeholder/dialogs/placeholder.js index beb43a5..a428487 100644
a b 31 31 this.setValue( element.getText().slice( 2, -2 ) ); 32 32 }, 33 33 commit: function( element ) { 34 var text = '[[' + this.getValue() + ']]'; 34 var placeholderTag = editor.config.placeholderTag || '[[$CONTENT$]]', 35 text = placeholderTag.replace( '$CONTENT$', this.getValue() ); 35 36 // The placeholder must be recreated. 36 37 CKEDITOR.plugins.placeholder.createPlaceholder( editor, element, text ); 37 38 } -
plugins/placeholder/plugin.js
diff --git a/plugins/placeholder/plugin.js b/plugins/placeholder/plugin.js index 0ddf8f0..0d2ce10 100644
a b 9 9 */ 10 10 11 11 (function() { 12 var placeholderReplaceRegex = /\[\[[^\]]+\]\]/g;13 12 CKEDITOR.plugins.add( 'placeholder', { 14 13 requires: 'dialog', 15 14 lang: 'en,bg,cs,cy,da,de,el,eo,et,fa,fi,fr,he,hr,it,ku,nb,nl,no,pl,tr,ug,uk,vi,zh-cn', // %REMOVE_LINE_CORE% … … 64 63 65 64 editor.on( 'contentDom', function() { 66 65 editor.editable().on( 'resizestart', function( evt ) { 67 66 if ( editor.getSelection().getSelectedElement().data( 'cke-placeholder' ) ) 68 67 evt.data.preventDefault(); 69 68 }); 70 69 }); … … 75 74 afterInit: function( editor ) { 76 75 var dataProcessor = editor.dataProcessor, 77 76 dataFilter = dataProcessor && dataProcessor.dataFilter, 78 htmlFilter = dataProcessor && dataProcessor.htmlFilter; 77 htmlFilter = dataProcessor && dataProcessor.htmlFilter, 78 placeholderReplaceRegex = editor.config.placeholderReplaceRegex || /\[\[[^\]]+\]\]/g; 79 79 80 80 if ( dataFilter ) { 81 81 dataFilter.addRules({ … … 103 103 104 104 CKEDITOR.plugins.placeholder = { 105 105 createPlaceholder: function( editor, oldElement, text, isGet ) { 106 var element = new CKEDITOR.dom.element( 'span', editor.document);106 var element = new CKEDITOR.dom.element( 'span', editor.document); 107 107 element.setAttributes({ 108 108 contentEditable: 'false', 109 109 'data-cke-placeholder': 1,