This module provides the included "ckgeshi" plugin the current settings from GeSHi Filter, so that CKEditor can create code-regions that will be highlighted by GeSHi Filter module.
As of yet, no modules have been written to do this - provide CKEditor the ability to integrate fully with the GeSHi Filter module. Sure you can switch to Plain-Text mode (exit CKEditor) or use your own Input Format without using CKEditor.
However this module enables CKEditor's WYSIWYG and Source modes to interact with GeSHi code-regions properly.

Project Page: http://drupal.org/sandbox/lonewolfcode/1624868
Git Repository: http://drupalcode.org/sandbox/lonewolfcode/1624868.git 7.x-2.x
Written for Drupal 7.x

See project page for screenshots.

CommentFileSizeAuthor
#3 codesniffer-ckgeshi.txt22.29 KBKrisBulman

Comments

rrbambrey’s picture

Assigned: lonewolfcode » Unassigned
Status: Needs review » Needs work

Hi there,

A couple of message from automated review:
There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
There is a git tag that has the same name as the branch 7.x-2.x. Make sure to remove this tag to avoid confusion.

Manual Review:
This isn't much of a manual code review as a manual overview.

  • I strongly recommend running your module through http://drupal.org/project/coder for starters to check your coding standards I can see a lot of non-standard commenting, indentation etc. going on in there.
  • Also, is there a reason that this module seems to appear as a single submodule in a directory with only one file (the .info file) in the main directory?
  • I see you have included 3rd party plugins, it's recommended to use the Library API module for including these.
  • I'm a little confused as to why your module contains patch files - seemingly to other modules.
  • All module file names should be prefixed with the module short name

That's quite a bit to be getting on with for now, will be happy to do a more in depth review when those issues are dealt with

lonewolfcode’s picture

Status: Needs work » Needs review

I really appreciate your assistance with this review and overview. I'm doing my best to adapt to the drupal standards in a timely manor :)

I have pushed the required updates to the master branch - now contains only proper readme file, and tags have been updated properly.

    7.x-2.0 branch updates
  • I have ran the project through Coder, and updated it's documentation & spacing configurations respectively.
  • I had placed it within a subfolder named after the plugin needlessly; files are now located properly in main directory.
  • That 3rd party plugin is actually not 3rd party in this case. It is the true power of this module, I wrote it from top to bottom, and it is an extension of CKEditor module. Basically, CKEditor module provides a hook_ckeditor_plugin() function, which allows anyone to add a plugin to the ckeditor configuration & it's toolbar thereafter. So this is the "proper" way to include a ckeditor plugin, as opposed to dragging and dropping the plugin folder into the CKEditor modules "plugins" folder. :)
  • I've renamed the .patch files properly to respect the module that they must patch
  • I have updated the file 'default_options' to use the naming standard prefixed by module name.

Thanks again for your assistance and detailed review. This has helped me a lot in many ways (understanding Git, use of Coder module, naming of files and their proper locations). Truly much appreciated :)

KrisBulman’s picture

Status: Needs review » Needs work
StatusFileSize
new22.29 KB

Great module concept, I've been looking for reliable syntax highlighting in drupal for ages, hope this fills the gap when it's ready. A couple things:

There is still another file in your master branch, and only the README.txt should be there.

Pretty sure Step 3. of the installation (patching ckeditor) isn't going to fly for a full module release, I could be wrong, but you may have to wait for it to be included into CKEditor first.. I've never seen any other module on d.o. provide a patch for another module.

Why are there 2 .info files?

  • ckgeshi___a_ckeditor_plugin_for_geshi_filter.info
  • ckeditor_geshi.info

I cloned the 7.x-2.x branch and ran it through code sniffer locally and have attached the results, you may want to install it and check over your code to assure you got everything.

lonewolfcode’s picture

Status: Needs work » Needs review

Thank you very much for your interest and review.

  • I'm definitely a newbie in terms of drupal code standards and git usage, so that is the reason for the lingering files in the master branch, and in the 7.x-2.x. I have removed them (extra .info files) from the branches.

  • I agree, I too have never seen a .patch file included as mandatory for installation. Unfortunately, I have a feeling it may not change any time soon - the CKEditor module has a very large amount of issue tickets, and though it is a very stable and simple change, it may not be anywhere near being on their todo list.
    The only other way I can theorize to avert the need for this patch, would be to "hack" the ckeditor Drupal.ckeditorOff function with something such as:
    // JavaScript :
    var func_originalOff = Drupal.ckeditorOff;
    Drupal.ckeditorOff = function(textarea_id) {
       // these two logic-checks are performed by the original function, prior to performing anything
       // so they are duplicated here to preserve functionality:
       if (!CKEDITOR.instances || typeof CKEDITOR.instances[textarea_id]) === 'undefined') return;
       if (!CKEDITOR.env.isCompatible) return;
    
       // fire the event that notifies ckeditor is about to be destroyed (purpose of previous .patch file)
       CKEDITOR.instances[textarea_id].fire('beforeCKEditorOff');
       // and finally, call the original function:
       func_originalOff(textarea_id);
    };

    Though this would mean the .patch file isn't needed, it is indeed a hack.
    I'm honestly not sure which of the two would be the better solution, in terms of drupal-ethics and drupal-practicality. However for the sake of moving forward, I have integrated the above and removed the need for the .patch file. Updated the readme & project page to reflect this change. I'm beginning to see how useful git really is. :)


  • I have ran the code through Coder and Codesniffer on my system, and pushed the latest to the 7.x-2.x branch.


  • Thank you again for your review and perspective on this, I think the above change is indeed a logical and smart step forward.

mitchell’s picture

Status: Needs review » Fixed

Thanks for your contribution, lonewolfcode!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on irc in #drupal-contribute. So, come hang out and get involved!

Thanks also to rrbambrey and KrisBulman for helping lonewolfcode!! I hope you guys will continue with your support to this project; definitely consider subscribing to the project's issue queue updates.

mitchell’s picture

Status: Fixed » Needs review

@lonewolfcode: I've been notified by a more experienced moderator that I acted too quickly with approving your application, and looking closer, I see that my oversight was unfortunate because there are few things that I found which can be improved. I liked everything that I did look at, but I should have done a more thorough review to properly assist you. So, please understand that that you have not done anything incorrectly, and that my error is a sign that I need a little more experience with this process. No worries; I'm compiling my review notes now and will be happy to approve your application asap and in accordance with the outlined process. I apologize for any inconvenience I have caused.

mitchell’s picture

Status: Needs review » Needs work

Hi, lonewolfcode.

I didn't get a chance to complete the installation and test this personally yet, because geshi was giving me some trouble, but I'll give it another try later. Thank you though for including screenshots on your project page. Here are a few improvements to consider, the first is the only major one:

  • You're using CKGeshi in your project name and ckeditor_geshi for your module namespace. The project name, short name, and filenames are meant to all match. Either one seems good, and then " - CKEditor plugin for GeSHi Filter" should be moved to the project description.
  • The default branch can now be set in your project's settings.
  • The project page can be shortened by moving installation notes to an INSTALL.txt or a documentation page referenced in your project's resources.
  • Usually projects have a README.txt or README.md, but a README.HTML isn't common.
  • It appears there have been some commits recently to CKEditor, so could you please verify that the patch/monkeypatch is still necessary? Another approach that some projects use in some of the earlier releases is to require a patch from an issue that needs review or is RTBC.
lonewolfcode’s picture

Status: Needs work » Needs review

Thank you very much mitchell. No inconvenience at all, I definitely appreciate your swift efforts to push this module to a full state, the developer information, and your review. I have made the following changes in accordance & pushed to git repo:

  • Renamed project title to ckeditor_geshi, updated references in code as well to reflect this single title
  • Default branch has now been assigned to 7.x-2.x
  • I've shortened the "INSTALLATION" section to reference the new INSTALL.txt file, removed some redundant information, and updated the README.txt to include the extra details that aren't necessary on project page.
  • README.html has been removed, and README.txt updated to reflect project page changes
  • Verified latest changes to CKEditor do not include Issue Request. At the moment though, no .patch is necessary, the hooking of Drupal.ckeditoroff function (provided by CKEditor) is so far 100% stable by my tests (thanks to KrisBulman for the idea). If CKEditor resolves the issue, I'll update this project, though currently is not a true problem for end-users

Thanks again for the review, assistance, and information. If any further changes are necessary to progress into full-stage, I'll do my best to promptly address them. I'm very excited to be releasing my first module and joining the developer-side of Drupal.org. I will do my best to be a good and useful member to the community, starting with some module reviews :)

gedur’s picture

Status: Needs work » Needs review

Hi, lonewolfcode.

Test with the dependencies:

- GeSHi Filter 7.x-1.0
- Ckeditor 7.x-1.9

I've found some minor issues:

- There are many tabs indent (you can found it fast with the coder module).

- Maybe it's beacause of a bad configuration on my test but:
- The code language is not saving. (it dissapears on node save)
- On node add with only the full html configured, I change the text format to full_html and added the geshi dummy if form validation fails the textarea get empty, If the validation doesn't fails the node saves empty. (ONLY if I specify a languagecode both cases).

I hope it helps!

marcoka’s picture

this is great, i tried something similar, but yours is better. i am getting the repo now.

lonewolfcode’s picture

Status: Needs review » Needs work

@ GeduR,
Thanks for your review and assistance with this. I was not able to reproduce the problems you described, but I know for a fact that it is due to the Javascript code.
I wonder if you are using Internet Explorer, and what version (I've only tested it on 7.0) ?
Also did you assign the weights such that CKEditor_GeSHi (Filter) is BEFORE the GeSHi module's (Filter) - per installation instructions?
Finally, what type of code are you submitting within the form? If you can't see the code within CKEditor, then something is messing up in the Javascript plugin.

I'm working to add some additional error checking for form validation - though I cannot seem to replicate the issue you describe on my setup.
Changed the status to Needs Work, so that I can look into this and resolve it.

Thanks again :)

@ e-anima,
Thank you for the support and trial run. es ist sehr geschatzt :)

gedur’s picture

Status: Needs review » Needs work

@ lonewolf I have test it with chrome on Ubuntu. And yes the wights are set like you say.

My code was basic:

 <?php print "hello world"; ?>

If nobody have the same problems maybe a chrome plugging (on my browser) is affecting, in this case there's nothing related to your module :). ( I'll test it with firefox as soon as posible.)

klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

klausi’s picture

Issue summary: View changes

fixed typo