Closed (fixed)
Project:
Syntax Highlighter
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Nov 2009 at 14:31 UTC
Updated:
20 Dec 2009 at 17:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
mattyoung commentedwould you like to make a patch?
Comment #2
mattyoung commentedin the latest dev release, I added Drupal.behaviors.syntaxhighlighter() for AJAX support, please test. I don't have any AJAX setup to test this so I need your help.
If you report back this works, then I'll make a release.
Thanks!
Comment #3
mrfelton commentedUnfortunately not... for an example:
1. http://www.kirkdesigns.co.uk/projects
1. click on the blue 'Drupal modules' button at the top,
2. Select Path Filter from the left - That is loading http://www.kirkdesigns.co.uk/project/pathfilter onto the page using ajax, but the syntax highlighter is missing.
Comment #4
mattyoung commentedI misspelled
behviorsinstead ofbehaviorsI've checked in the fix, please try again.
Hope I didn't waste too much of your time. This is what I get when I don't have the right setup to test things myself. I'll buy you a bear if you go to Drupalcon next year for this mix up.
Let me know how it goes and make sure you get the latest 'dev' version after the release bot get to it.
You can be sure it's the latest if the version string in syntaxhighlighter.module is:
Comment #5
mattyoung commented~
Comment #6
mrfelton commentedI think your javascript could do with some work! I'm cleaning it up now, I'll have a patch shortly... Fancy giving me co-maintainership?
Comment #7
mrfelton commentedOK, the attached patch works for me. Sorry, but I couldn't work with all that inline JavaScript, so I reworked it to use an external javascript file. Much more readable... Please check it trough and let me know what you think.
Tom
Comment #8
mattyoung commented>Fancy giving me co-maintainership?
How do I do this? I've given you CVS access. What else do I do to make you co-maintainer?
Comment #9
mrfelton commentedThat's it. I'm now a co-maintainer of the project and am happy to provide my help where I can :)
Can you give the syntax highlighter a quick test with my patch applied to ensure that I didn't break anything else in the process... seems to all be working to me, but maybe you know something I don't...
Comment #10
mattyoung commentedOn page load, highlight doesn't happen because there is no page load ready handler in the new syntaxhighlighter.js file, I add one and took out the 'defer' flag but it's not working. Can you see why it's not working? I had to go to a meeting now and cannot debug it at the moment.
also, when everything is working, minify the js file and use that instead.
Thx!
Comment #11
mrfelton commentedYou don't need an onload event. behaviors fire onload, as well as whenever new elements are inserted into the doc. It was working well for me, so strange that it wasn't for you... I'll have a look and see what I can do.
Comment #12
mrfelton commentedWhat browser/os are you using?
Comment #13
mrfelton commentedShould be good now. Committed. I also minified the JS and committed that too.
Comment #14
mattyoung commentedIt doesn't work for me.
see http://hddigitalworks.com/syntax-highlighter
no highlighting...
tried on chrome, firefox, opera and safari.
Comment #15
mrfelton commentedplease try this patch.
Comment #16
mrfelton commentedActually, this version may be better:
Comment #17
mattyoung commentedstill not working :(
see http://hddigitalworks.com/syntax-highlighter
Until everything is working, don't use the minify js file yet for better debugging (maybe the minify version is different?). Put '
alert("....")' in there to see if it's actually running?Also, don't use the '$' variable in syntaxhighlighter.js, use 'jQuery' instead. This is the recommended way in D7 actually for better compatibility with other js lib because they might be defining the '$' at the global level.
Comment #18
mrfelton commentedcan you try just altering the .module to use the non-minified version? I actually forgot to redo the minification, so probably didn't even see the new code with either of those patches.
Problem for me is that this works on all my test sites, but not on your one - difficult for me to test.
Comment #19
mrfelton commentedAttached is the altered patch to use the non minified version.
Comment #20
mrfelton commentedThis version uses the D7 jQuery style (at least, this is what has been used throughout the D7 codebase).
Comment #21
mattyoung commentedTom: it works!
See: http://hddigitalworks.com/syntax-highlighter
You are a js wizard :). My head spins just looking at your beautiful code.
Comment #22
mrfelton commentedGood news, re-minified the js and committed. thanks for testing.