Ticket #5654 (closed New Feature: fixed)

Opened 4 years ago

Last modified 3 years ago

Port 'Placeholder' to v3

Reported by: garry.yao Owned by: Saare
Priority: Normal Milestone: CKEditor 3.5
Component: General Version:
Keywords: Cc:

Description

Placeholder is one FCKEditor 2.x plugin that introduce a way to present none-editable content in wysiwyg mode, similar with 'fakeobject' but allow dynamic content.

Attachments

placeholder.gif (96 bytes) - added by Saare 4 years ago.
5654.patch (6.9 KB) - added by Saare 4 years ago.
5654_2.patch (10.0 KB) - added by Saare 4 years ago.
5654_3.patch (10.2 KB) - added by Saare 4 years ago.
5654_4.patch (10.2 KB) - added by garry.yao 4 years ago.
5654_5.patch (10.0 KB) - added by Saare 4 years ago.
5654_6.patch (10.5 KB) - added by Saare 4 years ago.
5654_7.patch (10.2 KB) - added by Saare 4 years ago.

Change History

comment:1 Changed 4 years ago by garry.yao

  • Milestone changed from CKEditor 3.4 to CKEditor 3.5

comment:2 Changed 4 years ago by Saare

  • Status changed from confirmed to assigned
  • Owner set to Saare

comment:3 Changed 4 years ago by fredck

  • Milestone changed from CKEditor 3.4.1 to CKEditor 3.5

Changed 4 years ago by Saare

Changed 4 years ago by Saare

comment:4 Changed 4 years ago by Saare

  • Status changed from assigned to review

comment:5 Changed 4 years ago by garry.yao

  • Status changed from review to review_failed

Let's update the menu icon, and for plugins that does not get into core, we need a sample page for it.

Changed 4 years ago by Saare

comment:6 Changed 4 years ago by Saare

  • Status changed from review_failed to review

comment:7 Changed 4 years ago by fredck

  • Status changed from review to review_failed

This is the typical case of "pure plugin" implementation, so let's leave the lang entries into the plugin directory as well.

Changed 4 years ago by Saare

comment:8 Changed 4 years ago by Saare

  • Status changed from review_failed to review

Changed 4 years ago by garry.yao

comment:9 Changed 4 years ago by garry.yao

  • Status changed from review to review_failed

The way of how plugin language files loaded is wrong, the plugin system has already 'well established' infrastructure for load lang files, check 'uicolor' as an example.

Besides, double-click should simply opens the placeholder dialog.

Changed 4 years ago by Saare

comment:10 Changed 4 years ago by Saare

  • Status changed from review_failed to review

comment:11 Changed 4 years ago by garry.yao

  • Status changed from review to review_failed

The 'doubleclick' processing is too simple that it doesn't fill up dialog correctly, in additional, please use the following lines as sample content:

<p>This is a [[sample placeholder]]. You are using <a href="http://ckeditor.com/">CKEditor</a>. </p>

Changed 4 years ago by Saare

comment:12 Changed 4 years ago by Saare

  • Status changed from review_failed to review

The problem in fact was the detection of the element in the dialog.

comment:13 Changed 4 years ago by garry.yao

  • Status changed from review to review_failed

I think the 'onShow' logic is over complicated, how about:

				if ( isEdit )
				{
					var range = editor.getSelection().getRanges()[0];
					range.shrink( CKEDITOR.SHRINK_TEXT );
					var node = range.startContainer;
					while( node && !( node.type == CKEDITOR.NODE_ELEMENT && node.hasAttributes('_cke_placeholder') ) )
						node = node.getParent();
					this._element = node;
				}

Changed 4 years ago by Saare

comment:14 Changed 4 years ago by Saare

  • Status changed from review_failed to review

As we talked, there is an unresloved edge case, but we can live with it for now.

comment:15 Changed 3 years ago by garry.yao

  • Status changed from review to review_passed

comment:16 Changed 3 years ago by Saare

  • Status changed from review_passed to closed
  • Resolution set to fixed

Fixed with [6051].

comment:17 Changed 3 years ago by dinu

Reopen: accidental global var htmlFilter

plugin.js line 89: dataFilter = dataProcessor && dataProcessor.dataFilter; htmlFilter = dataProcessor && dataProcessor.htmlFilter;

There should be a comma instead of semicolon between them, or htmlFilter goes global.

comment:18 Changed 3 years ago by Saare

Thanks, fixed as a micro change with [6093].

comment:19 follow-up: ↓ 20 Changed 3 years ago by dinu

It's an easy hack to YUI Compiler to dump leaked vars, you could integrate in the build, especially easy since you have very few globals.

comment:20 in reply to: ↑ 19 Changed 3 years ago by fredck

Replying to dinu:

It's an easy hack to YUI Compiler to dump leaked vars, you could integrate in the build, especially easy since you have very few globals.

We use JavaScript Lint every once in a while, and always before producing releases. So this thing would get fixed. Thanks for the tip anyway.

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy