Commit ad487bf7 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Replace the hardcoded "CodeRay" css class name for highlighted elements.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3585 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent c03b4c2e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<% diff.each do |table_file| -%> <% diff.each do |table_file| -%>
<div class="autoscroll"> <div class="autoscroll">
<% if diff_type == 'sbs' -%> <% if diff_type == 'sbs' -%>
<table class="filecontent CodeRay"> <table class="filecontent">
<thead> <thead>
<tr><th colspan="4" class="filename"><%= table_file.file_name %></th></tr> <tr><th colspan="4" class="filename"><%= table_file.file_name %></th></tr>
</thead> </thead>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</table> </table>
<% else -%> <% else -%>
<table class="filecontent CodeRay"> <table class="filecontent syntaxhl">
<thead> <thead>
<tr><th colspan="3" class="filename"><%= table_file.file_name %></th></tr> <tr><th colspan="3" class="filename"><%= table_file.file_name %></th></tr>
</thead> </thead>
......
<div class="autoscroll"> <div class="autoscroll">
<table class="filecontent CodeRay"> <table class="filecontent syntaxhl">
<tbody> <tbody>
<% line_num = 1 %> <% line_num = 1 %>
<% syntax_highlight(filename, to_utf8(content)).each_line do |line| %> <% syntax_highlight(filename, to_utf8(content)).each_line do |line| %>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %> <% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
<div class="autoscroll"> <div class="autoscroll">
<table class="filecontent annotate CodeRay"> <table class="filecontent annotate syntaxhl">
<tbody> <tbody>
<% line_num = 1 %> <% line_num = 1 %>
<% syntax_highlight(@path, to_utf8(@annotate.content)).each_line do |line| %> <% syntax_highlight(@path, to_utf8(@annotate.content)).each_line do |line| %>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %> <% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
<table class="filecontent annotate CodeRay "> <table class="filecontent annotate">
<tbody> <tbody>
<% line_num = 1 %> <% line_num = 1 %>
<% @annotate.lines.each do |line| -%> <% @annotate.lines.each do |line| -%>
......
...@@ -52,7 +52,7 @@ module Redmine ...@@ -52,7 +52,7 @@ module Redmine
text.gsub!(/<redpre#(\d+)>/) do text.gsub!(/<redpre#(\d+)>/) do
content = @pre_list[$1.to_i] content = @pre_list[$1.to_i]
if content.match(/<code\s+class="(\w+)">\s?(.+)/m) if content.match(/<code\s+class="(\w+)">\s?(.+)/m)
content = "<code class=\"#{$1} CodeRay\">" + content = "<code class=\"#{$1} syntaxhl\">" +
Redmine::SyntaxHighlighting.highlight_by_language($2, $1) Redmine::SyntaxHighlighting.highlight_by_language($2, $1)
end end
content content
......
...@@ -27,7 +27,7 @@ li.change .copied-from:before { content: " - "} ...@@ -27,7 +27,7 @@ li.change .copied-from:before { content: " - "}
#changes-legend { float: right; font-size: 0.8em; margin: 0; } #changes-legend { float: right; font-size: 0.8em; margin: 0; }
#changes-legend li { float: left; background-position: 5px 0; } #changes-legend li { float: left; background-position: 5px 0; }
table.filecontent { border: 1px solid #ccc; border-collapse: collapse; width:98%; } table.filecontent { border: 1px solid #ccc; border-collapse: collapse; width:98%; background-color: #fafafa; }
table.filecontent th { border: 1px solid #ccc; background-color: #eee; } table.filecontent th { border: 1px solid #ccc; background-color: #eee; }
table.filecontent th.filename { background-color: #e4e4d4; text-align: left; padding: 0.2em;} table.filecontent th.filename { background-color: #e4e4d4; text-align: left; padding: 0.2em;}
table.filecontent tr.spacing th { text-align:center; } table.filecontent tr.spacing th { text-align:center; }
...@@ -45,6 +45,7 @@ table.filecontent th.line-num a { ...@@ -45,6 +45,7 @@ table.filecontent th.line-num a {
color: inherit; color: inherit;
} }
table.filecontent td.line-code pre { table.filecontent td.line-code pre {
margin: 0px;
white-space: pre-wrap; /* CSS2.1 compliant */ white-space: pre-wrap; /* CSS2.1 compliant */
white-space: -moz-pre-wrap; /* Mozilla-based browsers */ white-space: -moz-pre-wrap; /* Mozilla-based browsers */
white-space: -o-pre-wrap; /* Opera 7+ */ white-space: -o-pre-wrap; /* Opera 7+ */
...@@ -88,97 +89,84 @@ div.action_M { background: #fd8 } ...@@ -88,97 +89,84 @@ div.action_M { background: #fd8 }
div.action_D { background: #f88 } div.action_D { background: #f88 }
div.action_A { background: #bfb } div.action_A { background: #bfb }
/************* Coderay styles *************/ /************* CodeRay styles *************/
table.CodeRay { .syntaxhl .no { padding: 0px 4px }
background-color: #fafafa; .syntaxhl .code pre { overflow: auto }
} .syntaxhl .debug { color:white ! important; background:blue ! important; }
.CodeRay pre { margin: 0px }
.syntaxhl .af { color:#00C }
span.CodeRay { white-space: pre; border: 0px; padding: 2px } .syntaxhl .an { color:#007 }
.syntaxhl .av { color:#700 }
.CodeRay .no { padding: 0px 4px } .syntaxhl .aw { color:#C00 }
.CodeRay .code { } .syntaxhl .bi { color:#509; font-weight:bold }
.syntaxhl .c { color:#666; }
ol.CodeRay { font-size: 10pt }
ol.CodeRay li { white-space: pre } .syntaxhl .ch { color:#04D }
.syntaxhl .ch .k { color:#04D }
.CodeRay .code pre { overflow: auto } .syntaxhl .ch .dl { color:#039 }
.CodeRay .debug { color:white ! important; background:blue ! important; } .syntaxhl .cl { color:#B06; font-weight:bold }
.syntaxhl .co { color:#036; font-weight:bold }
.CodeRay .af { color:#00C } .syntaxhl .cr { color:#0A0 }
.CodeRay .an { color:#007 } .syntaxhl .cv { color:#369 }
.CodeRay .av { color:#700 } .syntaxhl .df { color:#099; font-weight:bold }
.CodeRay .aw { color:#C00 } .syntaxhl .di { color:#088; font-weight:bold }
.CodeRay .bi { color:#509; font-weight:bold } .syntaxhl .dl { color:black }
.CodeRay .c { color:#666; } .syntaxhl .do { color:#970 }
.syntaxhl .ds { color:#D42; font-weight:bold }
.CodeRay .ch { color:#04D } .syntaxhl .e { color:#666; font-weight:bold }
.CodeRay .ch .k { color:#04D } .syntaxhl .en { color:#800; font-weight:bold }
.CodeRay .ch .dl { color:#039 } .syntaxhl .er { color:#F00; background-color:#FAA }
.syntaxhl .ex { color:#F00; font-weight:bold }
.CodeRay .cl { color:#B06; font-weight:bold } .syntaxhl .fl { color:#60E; font-weight:bold }
.CodeRay .co { color:#036; font-weight:bold } .syntaxhl .fu { color:#06B; font-weight:bold }
.CodeRay .cr { color:#0A0 } .syntaxhl .gv { color:#d70; font-weight:bold }
.CodeRay .cv { color:#369 } .syntaxhl .hx { color:#058; font-weight:bold }
.CodeRay .df { color:#099; font-weight:bold } .syntaxhl .i { color:#00D; font-weight:bold }
.CodeRay .di { color:#088; font-weight:bold } .syntaxhl .ic { color:#B44; font-weight:bold }
.CodeRay .dl { color:black }
.CodeRay .do { color:#970 } .syntaxhl .il { background: #eee }
.CodeRay .ds { color:#D42; font-weight:bold } .syntaxhl .il .il { background: #ddd }
.CodeRay .e { color:#666; font-weight:bold } .syntaxhl .il .il .il { background: #ccc }
.CodeRay .en { color:#800; font-weight:bold } .syntaxhl .il .idl { font-weight: bold; color: #888 }
.CodeRay .er { color:#F00; background-color:#FAA }
.CodeRay .ex { color:#F00; font-weight:bold } .syntaxhl .in { color:#B2B; font-weight:bold }
.CodeRay .fl { color:#60E; font-weight:bold } .syntaxhl .iv { color:#33B }
.CodeRay .fu { color:#06B; font-weight:bold } .syntaxhl .la { color:#970; font-weight:bold }
.CodeRay .gv { color:#d70; font-weight:bold } .syntaxhl .lv { color:#963 }
.CodeRay .hx { color:#058; font-weight:bold } .syntaxhl .oc { color:#40E; font-weight:bold }
.CodeRay .i { color:#00D; font-weight:bold } .syntaxhl .of { color:#000; font-weight:bold }
.CodeRay .ic { color:#B44; font-weight:bold } .syntaxhl .op { }
.syntaxhl .pc { color:#038; font-weight:bold }
.CodeRay .il { background: #eee } .syntaxhl .pd { color:#369; font-weight:bold }
.CodeRay .il .il { background: #ddd } .syntaxhl .pp { color:#579 }
.CodeRay .il .il .il { background: #ccc } .syntaxhl .pt { color:#339; font-weight:bold }
.CodeRay .il .idl { font-weight: bold; color: #888 } .syntaxhl .r { color:#080; font-weight:bold }
.CodeRay .in { color:#B2B; font-weight:bold } .syntaxhl .rx { background-color:#fff0ff }
.CodeRay .iv { color:#33B } .syntaxhl .rx .k { color:#808 }
.CodeRay .la { color:#970; font-weight:bold } .syntaxhl .rx .dl { color:#404 }
.CodeRay .lv { color:#963 } .syntaxhl .rx .mod { color:#C2C }
.CodeRay .oc { color:#40E; font-weight:bold } .syntaxhl .rx .fu { color:#404; font-weight: bold }
.CodeRay .of { color:#000; font-weight:bold }
.CodeRay .op { } .syntaxhl .s { background-color:#fff0f0 }
.CodeRay .pc { color:#038; font-weight:bold } .syntaxhl .s .s { background-color:#ffe0e0 }
.CodeRay .pd { color:#369; font-weight:bold } .syntaxhl .s .s .s { background-color:#ffd0d0 }
.CodeRay .pp { color:#579 } .syntaxhl .s .k { color:#D20 }
.CodeRay .pt { color:#339; font-weight:bold } .syntaxhl .s .dl { color:#710 }
.CodeRay .r { color:#080; font-weight:bold }
.syntaxhl .sh { background-color:#f0fff0 }
.CodeRay .rx { background-color:#fff0ff } .syntaxhl .sh .k { color:#2B2 }
.CodeRay .rx .k { color:#808 } .syntaxhl .sh .dl { color:#161 }
.CodeRay .rx .dl { color:#404 }
.CodeRay .rx .mod { color:#C2C } .syntaxhl .sy { color:#A60 }
.CodeRay .rx .fu { color:#404; font-weight: bold } .syntaxhl .sy .k { color:#A60 }
.syntaxhl .sy .dl { color:#630 }
.CodeRay .s { background-color:#fff0f0 }
.CodeRay .s .s { background-color:#ffe0e0 } .syntaxhl .ta { color:#070 }
.CodeRay .s .s .s { background-color:#ffd0d0 } .syntaxhl .tf { color:#070; font-weight:bold }
.CodeRay .s .k { color:#D20 } .syntaxhl .ts { color:#D70; font-weight:bold }
.CodeRay .s .dl { color:#710 } .syntaxhl .ty { color:#339; font-weight:bold }
.syntaxhl .v { color:#036 }
.CodeRay .sh { background-color:#f0fff0 } .syntaxhl .xt { color:#444 }
.CodeRay .sh .k { color:#2B2 }
.CodeRay .sh .dl { color:#161 }
.CodeRay .sy { color:#A60 }
.CodeRay .sy .k { color:#A60 }
.CodeRay .sy .dl { color:#630 }
.CodeRay .ta { color:#070 }
.CodeRay .tf { color:#070; font-weight:bold }
.CodeRay .ts { color:#D70; font-weight:bold }
.CodeRay .ty { color:#339; font-weight:bold }
.CodeRay .v { color:#036 }
.CodeRay .xt { color:#444 }
...@@ -305,7 +305,7 @@ EXPECTED ...@@ -305,7 +305,7 @@ EXPECTED
RAW RAW
expected = <<-EXPECTED expected = <<-EXPECTED
<pre><code class="ruby CodeRay"><span class="no">1</span> <span class="c"># Some ruby code here</span> <pre><code class="ruby syntaxhl"><span class="no">1</span> <span class="c"># Some ruby code here</span>
</pre></code> </pre></code>
EXPECTED EXPECTED
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment