Open PeterBurner opened 8 years ago
Hi,
I've managed to make them work, but it seems to require also modifying the CodeMirror plugin. The CodeMirror plugin wraps everything in an anonymous function that loads on document.ready; I've instead gave that function a name, i.e. dokuwiki_codemirror_init, and then in the fastwiki plugin, in the _initEdit function, I simply add a line to run dokuwiki_codemirror_init().
Hope that helps.
cool workaround
thanks
am I getting this right, I have to replace function(a)
by function dokuwiki_codemirror_init(a)
in the scripts.min.js of codemirror?
unfortunately I can't test it right now
Search for jQuery(function(){"use strict";.... and replace that with function dw_cm_init(){"use strict";...
then at the bottom of the script, you need to run the function, so add jQuery(document).ready(dw_cm_init());
Then in the fastwiki plugin, in the _initEdit() function, add dw_cm_init(); ... I put it after if($editform.length == 0) return;
Let me know if it works!
great thanks i'll try that
Oh wait, also at the end of the script you need to remove the
);
that corresponds to the
jQuery(
that we replaced.
This patch might cause problems if you go in and out of edit mode more than once. Since codemirror is distributed compressed, I can't easily make and test a pull request, but I've submitted an issue with what I think is the right fix. https://github.com/albertgasset/dokuwiki-plugin-codemirror/issues/59
the CodeMirror Plugin isn't loaded on inline edit