Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
syntax highlighter
hi
im looking for syntax highlighter for local developers forum.
im trying GeshiColor 0.2 but doesnt work me with vanilla 1.1.2 and i dont know why... any idea ?
or.. Do you know about other syntax highligter ?
thank you ! (sry for bad english)
0
This discussion has been closed.
Comments
Someone familiar with Javascript should be able to get it running.
Comment Links 1.3.2
Forum Statistics 0.4.5
GeshiColor 0.2
Html Formatter 2.2
Invite-Only System 0.3.0.a
Members Page 1.2.1
Notify 1.2.0
Poll 1.3
Quotations 1.6
Who's Online 1.2
Yellow Fade 0.1
kses (X)HTML 0.4
some of this are inactives ...
Inside extensions/CommentLinks/default.php, around line 53 you will see this:
if ( strstr(strtolower($Context->BodyAttributes), 'onload=') ) { $Context->BodyAttributes = str_replace('onload="', 'onload="BaseUrl=\''. $Context->Configuration['BASE_URL'] . '\';DefaultFormat=\''. $Default . '\';InstalledFormats=Array('. $FormattersCSV . ');MenuTitle=\''. htmlentities($Context->GetDefinition('CommentLinks_Copy')) .'\';HideMenus();', $Context->BodyAttributes); } else { $Context->BodyAttributes .= ' onload="BaseUrl=\''. $Context->Configuration['BASE_URL'] . '\';DiscussionName=\''. htmlentities($Discussion->Name) . '\';DefaultFormat=\''. $Default . '\';InstalledFormats=Array('. $FormattersCSV . ');MenuTitle=\''. $Context->GetDefinition('CommentLinks_Copy') .'\';HideMenus();" '; }
Cut all that out and replace it with this:
$Head->AddString('<script type="text/javascript"><!--//--><![CDATA[//><!-- function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != "function") { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } CommentLinks.Init = function() { BaseUrl = \''. $Context->Configuration['BASE_URL'] .'\'; DefaultFormat = \''. $Default .'\'; DiscussionName = document.getElementsByTagName("title")[0].innerHTML.replace(/^.* - /, \'\'); InstalledFormats = Array('. $FormattersCSV .'); MenuTitle= \''. htmlentities($Context->GetDefinition('CommentLinks_Copy')) . '\'; HideMenus(); } AddLoadEvent(CommentLinks.Init); //--><!]]></script>');
CommentLinks.Init = function() { BaseUrl = \''. $Context->Configuration['BASE_URL'] .'\'; DefaultFormat = \''. $Default .'\'; DiscussionName = document.getElementsByTagName("title")[0].innerHTML.replace(/^.* - /, \'\'); InstalledFormats = Array('. $FormattersCSV .'); MenuTitle= \''. htmlentities($Context->GetDefinition('CommentLinks_Copy')) . '\'; HideMenus(); } AddLoadEvent(CommentLinks.Init); //--><!]]></script>');
OK, I'm afraid the regexp problem can't be easily fixed until I update the extension in the next day or two, (which also fixes the IE linebreaks) but for those other problems, replace the prettify.js file with this code and see what that does.