Hello,

Have you updating module to drupal 7 in your TODO list?

Thanks,
Alex

Comments

AlexAtNet’s picture

Issue tags: -#D7 +D7
Tiny3001’s picture

Subscribing

Aleksey Zubko’s picture

Subscribing

mike503’s picture

+1 please. no good clean syntax highlighting seems to exist for 7 right now.

jshvrsn’s picture

At the very least, the 'path' needs to be split into 'path' and 'filename' in 'wysiwyg_syntaxhl.module':

return array(
          'syntaxhl' => array(
          'path' => drupal_get_path('module', 'wysiwyg_syntaxhl') . '/tinymce/syntaxhl',
          'filename' => 'editor_plugin.js',
          'buttons' => array('syntaxhl' => t('SyntaxHighlighter')),
          'url' => 'http://github.com/RichGuk/syntaxhl',
          'load' => TRUE,
        ),
meecect’s picture

Yes, it is now. I will produce one shortly. Give me a week or so.

wesnick’s picture

StatusFileSize
new50.18 KB

Hi, had to use this module on D7, not much to change, but did refactor the directory structure to mimic other imce plugins for D7. Patch attached against 6.x-1.x

meecect’s picture

thanks wesnick, I'll look this over and if it looks right, I'll commit it to a new d7 branch and cut a release. Might take me 3 or 4 days to get to it, unfortunately.

eduardmanas’s picture

I just got it working for Drupal 7, and was about to suggest a patch for this module...

As jshvrsn suggested, the only change needed is removing editor_plugin.js from path and adding it to 'filename' (and updating the info file to version 7.x of course)

Great work guys!

willvincent’s picture

StatusFileSize
new1.19 KB

I confirm the only changes needed to get this working in D7 is moving the filename to its own element, and updating the path.

Here's a patch.

willvincent’s picture

I actually have not been successful in getting syntaxhighlighter to work in D7 when it uses the {syntaxhighlighter} format tags, I can only get it to work when using pre tags. As such, for this to work completely, I also had to modify the js, but the patch in #10 will get the this module working as expected in D7 (as far as I can tell).

threading_signals’s picture

Could not get it to work for nginx. It requires regex modifications I believe in a new location.

ajits’s picture

#7 : did not work for me.

$ git apply -v wysiwyg_syntaxhl_1082018.patch
wysiwyg_syntaxhl_1082018.patch:23: trailing whitespace.
SyntaxHL is a plugin for the Tinymce (http://tinymce.moxiecode.com/) javascript WYSIWYG editor 
wysiwyg_syntaxhl_1082018.patch:25: trailing whitespace.
The syntax highlighting is done using Syntax Highligher 
wysiwyg_syntaxhl_1082018.patch:26: trailing whitespace.
(http://code.google.com/p/syntaxhighlighter/) 
wysiwyg_syntaxhl_1082018.patch:49: trailing whitespace.
Changes: 
wysiwyg_syntaxhl_1082018.patch:67: trailing whitespace.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Checking patch README.txt...
Checking patch plugins/syntaxhl/README...
Checking patch plugins/syntaxhl/dialog.php...
Checking patch plugins/syntaxhl/editor_plugin.js...
Checking patch plugins/syntaxhl/editor_plugin_src.js...
Checking patch plugins/syntaxhl/img/highlight.gif...
error: cannot apply binary patch to 'plugins/syntaxhl/img/highlight.gif' without full index line
error: plugins/syntaxhl/img/highlight.gif: patch does not apply
Checking patch plugins/syntaxhl/js/dialog.js...
Checking patch plugins/syntaxhl/langs/en.js...
Checking patch plugins/syntaxhl/langs/en_dlg.js...
Checking patch plugins/syntaxhl/langs/zh.js...
Checking patch plugins/syntaxhl/langs/zh_dlg.js...
Checking patch tinymce/syntaxhl/README...
Checking patch tinymce/syntaxhl/dialog.php...
Checking patch tinymce/syntaxhl/editor_plugin.js...
Checking patch tinymce/syntaxhl/editor_plugin_src.js...
Checking patch tinymce/syntaxhl/img/highlight.gif...
error: cannot apply binary patch to 'tinymce/syntaxhl/img/highlight.gif' without full index line
error: tinymce/syntaxhl/img/highlight.gif: patch does not apply
Checking patch tinymce/syntaxhl/js/dialog.js...
Checking patch tinymce/syntaxhl/langs/en.js...
Checking patch tinymce/syntaxhl/langs/en_dlg.js...
Checking patch tinymce/syntaxhl/langs/zh.js...
Checking patch tinymce/syntaxhl/langs/zh_dlg.js...
Checking patch wysiwyg_syntaxhl.info...
error: while searching for:
name = "Wysiwyg SyntaxHighlighter Plugin"
description = "Wysiwyg editor plugin that integrates syntax highlighting into a normal &lt;pre&gt; element"
dependencies[] = wysiwyg
;dependencies[] = wysiwyg_preelementfix
dependencies[] = syntaxhighlighter
package = "User interface"
core = 6.x

error: patch failed: wysiwyg_syntaxhl.info:1
error: wysiwyg_syntaxhl.info: patch does not apply
Checking patch wysiwyg_syntaxhl.module...
error: while searching for:
* Implementation of hook_wysiwyg_plugin().
*/
function wysiwyg_syntaxhl_wysiwyg_plugin($editor) {
  // The folowing variable is needed to make sure drupal_add_js isn't called twice
  // taken from the example in imce.module
  static $integrated;
  switch ($editor) {
    case 'tinymce':
      if (!isset($integrated)) {
        $integrated = TRUE;
        $languages=array();
        foreach ( variable_get('syntaxhighlighter_enabled_languages', array('shBrushPhp.js')) as $ind=>$val) {
          if ($val) {
            $languages[]=array('value' => strtolower(substr(substr($ind, 7),0,-3)), 
              'text' => substr(substr($val, 7),0,-3)
            );            
          }
        }
        $settings = array(
          'wysiwyg_syntaxhl' =>  array('languages' => $languages)
        );
      drupal_add_js($settings, 'setting');
    }
    $path = drupal_get_path('module', 'wysiwyg_syntaxhl') . '/tinymce/syntaxhl/editor_plugin.js';
    return array(
        'syntaxhl' => array(
          'path' => $path,
          'buttons' => array('syntaxhl' => t('SyntaxHighlighter')),
          'url' => 'http://drupal.org/project/wysiwyg_syntaxhl',
          'load' => TRUE,
        ),
    );
  }
}

error: patch failed: wysiwyg_syntaxhl.module:19
error: wysiwyg_syntaxhl.module: patch does not apply