CKFinder Integration

Community Driven Extensions Project
pelzrutsche
Posts: 39
Joined: 10 Dec 2011, 10:50

16 May 2012, 13:02

Hi,

I'm currently working on the integration of CKFinder with pe:ckEditor. Is the PE team planning to add CKFinder support at some point?
PrimeFaces 4.0.6 | MyFaces 2.1.13 | Tomcat 7.0.47
SpringSource Tool Suite 3.4.0.RELEASE | JDK 1.7
Windows 7 | FireFox, Chrome, IE

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

16 May 2012, 13:06

What exactly do you mean?
Would you like an pe:ckFinder tag? If yes, no sorry. CKFinder is too complex and would cost very much effort. Also CKFinder is not for free.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

pelzrutsche
Posts: 39
Joined: 10 Dec 2011, 10:50

16 May 2012, 14:53

zoigl wrote:What exactly do you mean? Would you like an pe:ckFinder tag? If yes, no sorry. CKFinder is too complex and would cost very much effort. Also CKFinder is not for free.
I know, never mind. I was thinking about some client-side callbacks in pe:ckEditor that allow to start CKFinder once an editor instance has loaded. Yet, that might be done in a custom configuration file as well.
PrimeFaces 4.0.6 | MyFaces 2.1.13 | Tomcat 7.0.47
SpringSource Tool Suite 3.4.0.RELEASE | JDK 1.7
Windows 7 | FireFox, Chrome, IE

pelzrutsche
Posts: 39
Joined: 10 Dec 2011, 10:50

16 May 2012, 16:43

Well, something like onLoad for pe:ckEditor would definitely help.

Code: Select all

<pe:ckEditor onLoad="/* snippet */" />
And the snippet passed to onLoad is executed inside a callback function which gets passed the widget and/or the editor instance

Code: Select all

function onLoadCallback(editor) { /* snippet */ }
PrimeFaces 4.0.6 | MyFaces 2.1.13 | Tomcat 7.0.47
SpringSource Tool Suite 3.4.0.RELEASE | JDK 1.7
Windows 7 | FireFox, Chrome, IE

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

16 May 2012, 16:55

I think this is easy, can you create an feature request?
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

pelzrutsche
Posts: 39
Joined: 10 Dec 2011, 10:50

16 May 2012, 17:09

Alright, here you go, I created the issue.
PrimeFaces 4.0.6 | MyFaces 2.1.13 | Tomcat 7.0.47
SpringSource Tool Suite 3.4.0.RELEASE | JDK 1.7
Windows 7 | FireFox, Chrome, IE

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

17 May 2012, 02:45

It's already possible via "initialize" event.

<pe:ckEditor...>
<pe:javascript event="initiliaze" execute="onLoadCallback(myWidgetWar.instance)" />

</pe:ckEditor>
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

pelzrutsche
Posts: 39
Joined: 10 Dec 2011, 10:50

17 May 2012, 10:12

zoigl wrote:It's already possible via "initialize" event.
<pe:ckEditor...>
<pe:javascript event="initiliaze" execute="onLoadCallback(myWidgetWar.instance)" />
</pe:ckEditor>
Great :-), thank you, I didn't know that. So if I understand ClientBehaviour correctly I catches the same events as p:ajax but I can't find the event "initialize" anywhere in the docs. Is it specific to PF Ext components?
PrimeFaces 4.0.6 | MyFaces 2.1.13 | Tomcat 7.0.47
SpringSource Tool Suite 3.4.0.RELEASE | JDK 1.7
Windows 7 | FireFox, Chrome, IE

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

17 May 2012, 10:37

yep!
Each component has it own events and i added an initialize event :)

http://fractalsoft.net/primeext-showcas ... Editor.jsf
Please scroll down @ "Documentation pe:codeMirror" - there is a list with all events.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

pelzrutsche
Posts: 39
Joined: 10 Dec 2011, 10:50

18 May 2012, 00:46

Thanks a lot zoigl, it works...almost.

Referencing the pe:ckEditor by it's widgetVar breaks once I create multiple pe:ckEditor within a ui:repeat. I know that's not an issue with PrimeFaces Ext. I could work around that issue if I had direct access to the widget when the code of pe:javascript is executed. However, that information gets lost during PrimeFaces Ext' event handling. The first argument (source) passed to the function, wrapping the code of pe:javascript, is the ID of the DOM element but not the widget. Is this by design?

Example

Code: Select all

<pe:ckEditor>
    <pe:javascript event="initialize" execute="console.log(arguments)" />
</pe:ckEditor>
Console output

Code: Select all

["form\:j_idt5\:j_idt7", "initialize", undefined, Object { params={...}}]
It would be nice to have the widget bound to "this" or the editor-instance passed as part of "params", too.
PrimeFaces 4.0.6 | MyFaces 2.1.13 | Tomcat 7.0.47
SpringSource Tool Suite 3.4.0.RELEASE | JDK 1.7
Windows 7 | FireFox, Chrome, IE

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests