Opened 15 years ago

Closed 15 years ago

#4919 closed Bug (fixed)

Jquery adapter sample file is incorrect

Reported by: Wiktor Walc Owned by: Tobiasz Cudnik
Priority: Normal Milestone: CKEditor 3.1
Component: General Version: SVN (CKEditor) - OLD
Keywords: Confirmed Review? Cc:


There is a very specific way of creating samples for CKEditor. A short description is available here:

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: url shouldn't be used any more in the sample text.

Attachments (1)

4919.patch (3.1 KB) - added by Tobiasz Cudnik 15 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 15 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 15 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 15 years ago by Tobiasz Cudnik

Attachment: 4919.patch added

comment:3 Changed 15 years ago by Tobiasz Cudnik

Keywords: Review? added
Owner: set to Tobiasz Cudnik

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">

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">

It caused me some troubles.

comment:4 Changed 15 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: newclosed

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 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy