Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#10804 closed Bug (fixed)

CKEDITOR_GETURL isn't used with some plugins it should be used.

Reported by: Thomas Andraschko Owned by:
Priority: Normal Milestone: CKEditor 4.4.5
Component: General Version: 4.0
Keywords: Cc:

Description (last modified by Jakub Ś)

  1. contents.css should also use CKEDITOR_GETURL to resolve this file in a custom way.

This is required for some technologies to overwrite the resource URL.

  1. loading images from the skin directory does not use CKEDITOR_GETURL
  1. preview.html should also use CKEDITOR_GETURL to resolve this file in a custom way. This is required for some technologies to overwrite the resource URL.
  1. smiley images should use CKEDITOR_GETURL
  1. magicline plugin should use CKEDITOR_GETURL to resolve the icons.png
  1. wsc plugin does not use CKEDITOR_GETURL to resolve tmp.html

Change History (11)

comment:1 Changed 10 years ago by Jakub Ś

Description: modified (diff)
Summary: contents.css does not use CKEDITOR_GETURLCKEDITOR_GETURL isn't used with some plugins it should be used.
Version: 4.24.0

comment:2 Changed 10 years ago by Jakub Ś

#10805, #10806, #10807, #10808, #10809 were marked as duplicate.

comment:3 Changed 10 years ago by Jakub Ś

Status: newconfirmed

@tandraschko could you perhaps describe your use case in more detail to give us better view on this issue? I see many plugins use getURL and your bug report sounds reasonable but it would be nice to know your case.

comment:4 Changed 10 years ago by Thomas Andraschko

I've actually created a wrapper around CKEditor for the JavaServerFaces technology for my own open source project called PrimeFaces Extensions. Resources (styles, images, scripts, etc) in JSF can be received from database, a java JAR file or else. A resource URL in JSF looks like: http://localhost:8080/javax.faces.resources/jquery/jquery.js.xhtml?ln=primefaces

in CKEditor, the most resources are resolved via: CKEDITOR_GETURL('plugins/test/myTestFile.js')

I can easily convert this to the JSF structure with a custom CKEDITOR_GETURL method: https://github.com/primefaces-extensions/core/blob/master/src/main/resources/META-INF/resources/primefaces-extensions/ckeditor/widget.js

The problem now is that also many resources will be resolved via: var dir = CKEDITOR_GETURL('dir'); var resources = dir + "myScript.js";

I just can't handle this case. Therefore i modified the CKEditor code to:

var resources = CKEDITOR_GETURL(dir + "jquery.js");

The URL will look now like this: http://localhost:8080/javax.faces.resources/jquery/.xhtml?ln=primefaces/jquery.js

I my custom method, i can just split to url and move the "jquery.js" to the right direction.

A solution would be always call CKEDITOR_GETURL with the complete realtive resource url instead of getting the directory and the file in seperate steps.

Hope it's clear now :)

comment:5 Changed 10 years ago by Jakub Ś

It is nice to hear that CKEditor is used in other projects as server-side tag/component.

Hope it's clear now

Yes it is clear and I agree that CKEditor should have its code consistent so that third-party developers could use it in their projects with as little integration problems as possible.

comment:6 Changed 10 years ago by Thomas Andraschko

Is there any chance to fix this in the near future? I would like to upgrade the used CKEditor because of IE11 but it's currently very time consuming to alway "fix" the minified js code and find all those places.

comment:7 Changed 10 years ago by Jakub Ś

Currently there are more important issues so will not handle it at the moment but...

Please note that you can get CKEditor code from github make your change there, then keep updating code and building your very own release. Please see http://docs.ckeditor.com/#!/guide/dev_source and http://docs.ckeditor.com/#!/guide/dev_build.

You can also help us developing CKEditor by submitting pull request for this specific issue: http://docs.ckeditor.com/#!/guide/dev_contributing. You just need to get the code, make change and submit a pull request - https://help.github.com/articles/creating-a-pull-request.

comment:8 Changed 10 years ago by Thomas Andraschko

Hi,

i created a pull request for my changes in the master branch. Please have a look at it.

Regards, Thomas

comment:9 Changed 10 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.5
Resolution: fixed
Status: confirmedclosed

PR: https://github.com/ckeditor/ckeditor-dev/pull/119

I merged the PR to master, however I needed to revert one change. Smileys plugin cannot use CKEDITOR.getUrl() to resolve images' paths, because it appends timestamp which would end up in data.

I extracted this issue to #12366.

Thanks Thomas!

comment:10 Changed 10 years ago by Thomas Andraschko

Thank you for mergin! Is there any other chance to fix this for the smileys plugin? I would like to avoid to the touch the CKEditor code in the future if we do a release.

comment:11 Changed 10 years ago by Piotrek Koszuliński

We don't plan to work on this ticket at the moment, because we are getting close to CKEditor 4.5.0 so most the workforce is moved to it. However, it's pretty simple change so it's good for PR. Though it requires tests for example in https://github.com/ckeditor/ckeditor-dev/blob/master/tests/core/ckeditor/ckeditor.js. You can find more info about testing env in the Testing Environent guide.

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