I wanted to know what it takes to add a TinyMCE-plugin, so i asked in the Forum:
http://drupal.org/node/1240670
After getting a hint there, i was able to write a module for that.
Since i could not attach a file in the froum, i opened this issue here, to post my result.
The initial subject of my search was a way to get a rich Source Editor like CodeMirror to work in D7.
What i did find was a plugin for TinyMCE, called CodeMagic (http://codemagic.sutulustus.com/), which uses CodeMirror.
The hint in the Forum was, to look at another similar Module. But this was not similar enough for me. My limited to non-existing Drupal- and TinyMCE- knowledge allows me to do only simple copy-paste style work :-(
Then i found what i needed: A Module that adds an original TinyMCE-Plugin:
http://drupal.org/project/wysiwyg_imgmap
Officially it is for D6 only, so i first used it to bring CodeMagic to D6.
only after that, i found an issue asking for a D7-Port, which also had a reply with a D7 Module attached:
http://drupal.org/node/1127454#comment-4424564
So i adopted that too, and it works.
In general, i must say that i am quite clueless about what i did. I am new to Drupal, it is my first module, i don't know TinyMCE, and i am not a coder.
The work was only string-replacement, no real code writing.
the thing that i am least sure about, is the renaming of the function
_wysiwyg_default_path()
to
_codemagic_wysiwyg_default_path()
Without it, enabling the module did throw an error "cannot redeclare..." when mine and the original module were installed.
Bedides not knowing if i broke some conventions with my renaming here, i commented out a line that was clearly not needed for CodeMagic. Everything else i left as is, as ti worked on the first round of trial-error.
someone comment pls...
uploaded wrong files, corrected ones in following comment!
Comment | File | Size | Author |
---|---|---|---|
#1 | wysiwyg_codemagic-7.x-1.x-dev_0.zip | 8.08 KB | sirtet |
#1 | wysiwyg_codemagic-6.x-1.0.zip | 8.54 KB | sirtet |
wysiwyg_codemagic-6.x-1.0.zip | 8.53 KB | sirtet | |
wysiwyg_codemagic-7.x-1.x-dev_0.zip | 8.06 KB | sirtet |
Comments
Comment #1
sirtethere are the corrected files...
Comment #2
fizk CreditAttribution: fizk commentedThanks for bringing this to Drupal! I can give it a try and if it works, I'll create a new project for your module.
Cheers,
Yonas
--
TinymceSupport.com - Support, Consulting, and Development
Comment #3
fizk CreditAttribution: fizk commentedCongrats, you can access the project here: http://drupal.org/project/wysiwyg_codemagic
Cheers,
Yonas
--
TinymceSupport.com - Support, Consulting, and Development
Comment #4
fizk CreditAttribution: fizk commentedComment #4.0
fizk CreditAttribution: fizk commentedmsg. about attached wrong Files