Ticket #4919 (closed Bug: fixed)

Opened 5 years ago

Last modified 5 years ago

Jquery adapter sample file is incorrect

Reported by: wwalc Owned by: tobiasz.cudnik
Priority: Normal Milestone: CKEditor 3.1
Component: General Version: SVN (CKEditor) - OLD
Keywords: Confirmed Review? Cc:

Description

There is a very specific way of creating samples for CKEditor. A short description is available here: http://docs.cksource.com/FCKeditor_3.x/Design_and_Architecture/CKReleaser#Samples

In short, html samples are just templates and sample-specific content should be placed inside of elements with the following IDs:

  • headscript (optional): contains sample specific script to be loaded in the <head>.
  • styles (optional): contains sample specific styles.
  • html: contains the HTML data that effectively represents the sample.
  • code: contains the sample code, used to illustrate the API usage in the sample.

Another rule is that all sample files should be loading sample.js:

<script type="text/javascript" src="sample.js"></script>

In jqueryadapter.html the following files are loaded in the <head> section, which causes that sample processed by CKReleaser is not working:

Ideally, both files should be loaded in a script with id "headscript" and below there should be a jquery code $( function() ... } ); that is currently in a script that has no id attribute.

To test whether the template is correct, just launch _samples/sample.html?sample=jqueryadapter and see whether it works.

There is one more minor bug that can be corrected as well: http://www.fckeditor.net url shouldn't be used any more in the sample text.

Attachments

4919.patch (3.1 KB) - added by tobiasz.cudnik 5 years ago.

Change History

comment:1 Changed 5 years ago by tobiasz.cudnik

Problem here is that plain HTML script tag is the way for loading the adapter. Placing it in $() onDomReady callback will change the default setup and could create unnecessary difficulties for the developer which could use a sample as the base for the integration.

Is there a way to workaround those limitation for this specific sample ?

comment:2 Changed 5 years ago by tobiasz.cudnik

One possible way which seems to solve the problem is just to place those plain script tags inside div#html element.

Changed 5 years ago by tobiasz.cudnik

comment:3 Changed 5 years ago by tobiasz.cudnik

  • Owner set to tobiasz.cudnik
  • Keywords Review? added

Attached patch allows correct sample AND adapter file to be released.

There is also a bug with releaser when we paste such code inside the HEAD:

	<script type="text/javascript" id="headscript">
	//<![CDATA[
		$(function(){
		});
	//]]>
	</script>

It results in following error: "JavaException: java.lang.IllegalArgumentException: Illegal group reference".

Changing the code to following doesn't create the error:

	<script type="text/javascript" id="headscript">
	//<![CDATA[
		jQuery(function(){
		});
	//]]>
	</script>

It caused me some troubles.

comment:4 Changed 5 years ago by fredck

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

We've decided chancing the samples ([4851]) so we're not using anymore the template system. It was actually bringing important limitations to the samples, which were simply making them more complicated to the end developers.

This is not anymore an issue.

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