Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Very alpha: CKEditor in Vanilla 2

edited February 2010 in Vanilla 2.0 - 2.8
So I've uploaded my very alpha CKEditor plugin. Not as much work as I'd feared, it only required two modifications to Vanilla 2 proper:
  • The nl2br regex in the Html() formatter should have a config option
  • There should be a RemoveJsFile method to complement the AddJsFile method.
Now, the RemoveJsFile method could return a bool of whether or not the file existed, but as it could be found multiple times I suppose maybe the number of times found would be a good return value. (E.g. the count of $keys)

Anyway, the changes can be seen in this commit here: http://github.com/LouisStAmour/Garden/commit/c1ba39dbb3ee53671f4bb229de6799fc901dd092

As coded, this plugin might or might not be compatible with Vanilla Replies or VanillaCommentScore as I encountered an error at one point and disabled both of them, though it might be the JS' fault.

Also, @Mark, is it possible to override JS or CSS from within a plugin, avoiding the need to remove 'discussion.js' just to add it again with a slightly different name? Or should we work on making the JS more extensible? The main incompatibility lies within jQuery's serialize() of the form, which doesn't seem to call the textarea's overridden val() to get the CKEditor's changes and so instead saves the original unmodified textarea that was hidden. One alternative could be a trigger for such changes before serializing the form.

Oh and another change I've forgotten to make is to ensure all IDs are unique for textareas. (Right now they totally aren't, so my start.js overcomes that as necessary.) And to swap to using Google for hosting jQuery, though that could be part of future performance optimizations like 1.2 has received, I guess.

Comments

  • pnda007pnda007 New
    edited March 2010
    Sorry for digging this one up but seem to be one of the best additions to Vanilla 2 at the minute.

    Was just wondering if I were to enable other toolbar options, would the plugin fail? I'm talking formatting ones here rather than uploads. And second point, I don't seem able to locate the toolbar options config anywhere, a nudge in the right direction would be awesome.

    Regards.


    Edit: Seems I was doing it right the first time. Have toolbar config changes been disbaled in some way (either intentional or otherwise) or do they just not work?
  • edited March 2010
    Right now, toolbar options etc. are hard-coded within the plugin JavaScript files but should still follow CKeditor practices. Which features of CKeditor are you looking for? I've another version that adds oEmbed functionality, though I haven't yet added it to my Vanilla fork.
  • I eagerly await your release of the CKEditor oEmbed plugin! :D
  • @-Stash- I second that! This one is at the top of the list for my forum.
  • I don't have the time until Friday evening or the weekend to work on it further, but I'd appreciate any feedback on how it should work within Vanilla. Right now I'm thinking of having it scan for links in the text box, load them below the textbox, then create a new textbox below that to continue "building" the post. Thoughts?

    Oh and how should I handle regular links that aren't oEmbed enabled? Should I allow the embedded objects to be edited, and if so, that'll require potentially more changes to Vanilla for display. Or should I assume JavaScript as a requirement both to view and to edit this? Should there be other post "types" in the forum, such as for video, etc.?
  • I was envisaging a pure oEmbed plugin for CKEditor that would work using the CK stuff, but that's just because I want to be able to port it easily back to V1.2 ;)

    If you want to post another alpha with the oEmbed included in it I'd certainly be willing to take a look and give some feedback.
  • 22 days later, I've totally forgotten about this effort. Turns out they were looking for something quick with WordPress instead. The result isn't a forum, or even custom code, but seems to temporarily satisfy ...

    I'm also showing off a multitouch screen I just finished, and I've a two more projects and an exam in the next month. I should have more time, or at least upload what I have for oEmbed, in April. Remind me here or send me an alert on Twitter, where I'm @4lou.
Sign In or Register to comment.