naokij / dokuwiki-plugin-markdownextra

Parses PHP Markdown Extra blocks for dokuwiki with backlinks, header parser, toc support
Other
31 stars 27 forks source link

Add Meltdown editor #8

Closed jlgrall closed 10 years ago

jlgrall commented 10 years ago

This is for issue #7

Note: I did not add the Meltdown support for IE 7 and 8 because it uses conditional comments, which doesn't seem easy to do in DokuWiki. And its better to use a recent browser anyway :)

naokij commented 10 years ago

I have tried it in Chrome, Firefox and Safari on my Mac. But the editor doesn't work. However, your gist version works well.

My dokuwiki version: Release 2012-10-13 "Adora Belle"

jlgrall commented 10 years ago

I checked:

Can you look in the page source to see if the links to the css and js files were added ? There should be a few links with the word "meltdown" in them.

naokij commented 10 years ago

Yes, js and css files were loaded.

jlgrall commented 10 years ago

Ok, can you check if you have any js error in your console ?

Also in your console, check that:

naokij commented 10 years ago

I can see the editor. But when I clicked Bold button, "undefined" was inserted to the text area. And this error show in the console:

[Log] Failed to load surroundSelectedText (jquery.meltdown.js, line 19, x2)

jlgrall commented 10 years ago

Right, I have the same problem. The online Meltdown demo uses an older version of the code. Apparently there is a bug in the last Meltdown version.

jlgrall commented 10 years ago

Problem fixed :)

naokij commented 10 years ago

"Bold" button works now. But "Headers" still not work. One more thing, in Meltdown demo there is a preview area but I can't find it in your branch.

jlgrall commented 10 years ago

The headers buttons work for me. Unfortunately they don't insert the ### at the beginning of the line, but this is a Meltdown issue.

I am not sure I understand what you mean by a preview area in my branch. The preview for markdown should be automatically opened. I just made it so that it opens below the editor. You don't see it ? If you don't see it, try to press the far right button of the toolbar, which is named "Show preview".

I know that the actions of the toolbar are very basic. I also started to contribute to Meltdown to enhance it somehow. But it will come later...

naokij commented 10 years ago

When I clicked on "Headers" button, there is no "H1, H2..." drop list. And I get this error message in js console when the page is loaded:

TypeError: 'undefined' is not a function (evaluating 'outer.on')

And I can't find the preview area nor the "Show preview" button.

jlgrall commented 10 years ago

I have some time to work on this. Let's see what is the problem.

Sorry, I really can't reproduce your problems. I tried to reinstall the whole markdown-extra plugin from the commit f9b2e30 (the currently last commit in this pull request). But everything works fine. Maybe it is related to your version of DokuWiki which is older than mine, but it shouldn't make a difference, because Meltdown only uses JavaScript.

Could you try to temporarily completely replace markdown-extra with the version from the commit f9b2e30 ? And could you try to give me more informations about the errors that you get ?

naokij commented 10 years ago

I've tested it with a fresh installation of dokuwiki version 2013-12-08 "Binky". Everything works. I think this might a problem of compatibility. It doesn't work with 2012-10-13 "Adora Belle". Thanks for your contribution.

jlgrall commented 10 years ago

You are welcome.

Maybe the Adora Belle problem could be related to the versions of jQuery and Jquery UI that are shipped with DokuWiki. If you tell me what they are I can quickly test them.

naokij commented 10 years ago

It's jQuery v1.6.4 and jQuery UI 1.8.16

jlgrall commented 10 years ago

I tried for half an hour to find the problem with the old jQuery. I am giving up.

naokij commented 10 years ago

No problem.