You are here: Home > Latest news from Darcs > Fixes diff table borders on IE

Revision 20080502214034-9043f-87368f...

Fixes diff table borders on IE

TBody borders could not be fixed, unfortunately

app/helpers/application_helper.rb
public/stylesheets/motiro.css

Changes to application_helper.rb

97
        if chunk.separator?
        if chunk.separator?
97
98
          b.tbody :class => 'separator' do
          b.tbody :class => 'separator' do
98
99
            b.tr do
            b.tr do
99
100
              b.td
              b.th
100
101
              b.td('%s more lines' / chunk.num_lines.to_s, :colspan => '2')
              b.td('%s more lines' / chunk.num_lines.to_s, :colspan => '2')
101
102
              b.td
              b.th
102
103
            end
            end
103
104
          end
          end
104
105
        else  
        else  
105
106
          b.tbody :class => chunk.action.to_s do
          b.tbody :class => chunk.action.to_s do
106
107
            chunk.lines.each do |line|
            chunk.lines.each do |line|
107
108
              b.tr do
              b.tr do
108
109
                b.td {b << (line.original_position || '&nbsp;').to_s}
                b.th {b << (line.original_position || '&nbsp;').to_s}
109
110
                b.td {b.pre{b << (h(line.original_text) || '&nbsp;')}}
                b.td :class => 'l' do
110
111
                b.td {b.pre{b << (h(line.modified_text) || '&nbsp;')}}
                  b.pre {b << (h(line.original_text) || '&nbsp;')}
111
112
                b.td {b << (line.modified_position || '&nbsp;').to_s}
                end
112
 
                b.td {b.pre {b << (h(line.modified_text) || '&nbsp;')}}
113
 
                b.th {b << (line.modified_position || '&nbsp;').to_s}
114
113
              end
              end
115
114
            end
            end
116
115
          end
          end
117

Changes to motiro.css

173
}
}
173
174
174
175
table.diff {
table.diff {
175
176
    border: solid gray;
    border: solid #999;
176
177
    border-width: 1px 0 1px 0;
    border-width: 1px 0 1px 0;
177
178
    border-collapse: collapse;
    border-collapse: collapse;
178
179
    font-family: monospace;
    font-family: monospace;
179
12 more lines
192
    word-wrap: break-word;      /* IE 5.5+ */
    word-wrap: break-word;      /* IE 5.5+ */
192
193
}
}
193
194
194
195
table.diff td {
table.diff td, th {
195
196
    padding: .05em .4em .05em .4em;
    padding: .05em .4em .05em .4em;
196
197
}
}
197
198
198
199
table.diff col.line_number {
table.diff th {
199
 
    font-weight: normal;
200
200
    text-align: center;
    text-align: center;
201
201
    border: solid gray;
    border: solid #999;
202
202
    border-width: 0 1px 0 1px;
    border-width: 0 1px 0 1px;
203
203
}
}
204
204
205
 
table.diff td.l {
206
 
    border-right: 1px solid #999;
207
 
}
208
 
209
205
table.diff col.left {
table.diff col.left {
210
206
    border-right: 1px solid gray;
 
207
    width: 50%;
    width: 50%;
211
208
}
}
212
209
213
1 more lines
211
    width: 50%;
    width: 50%;
215
212
}
}
216
213
217
 
table.diff tbody {
218
 
    border: #aaa solid;
219
 
    border-width: 1px 0 1px 0;
220
 
}
221
 
222
214
tbody.unchanged {
tbody.unchanged {
223
215
    background: #FFF;
    background: #FFF;
224
 
    border: none;
225
216
}
}
226
217
227
218
tbody.modification {
tbody.modification {
228
219
    background: #ffffb8;
    background: #ffffb8;
229
220
    border: #606060 solid;
 
221
    border-width: 1px 0 1px 0;
 
222
}
}
230
223
231
224
tbody.addition {
tbody.addition {
232
225
    background: #b8ffb8;
    background: #b8ffb8;
233
226
    border: #606060 solid;
 
227
    border-width: 1px 0 1px 0;
 
228
}
}
234
229
235
230
tbody.deletion {
tbody.deletion {
236
231
    background: #ffb8b8;
    background: #ffb8b8;
237
232
    border: #606060 solid;
 
233
    border-width: 1px 0 1px 0;
 
234
}
}
238
235
239
236
tbody.separator {
tbody.separator {
240
237
   background: #d0d0c4;
   background: #d0d0c4;
241
238
   text-align: center;
   text-align: center;
242
239
   border: #606060 solid;
 
240
   border-width: 1px 0 1px 0;
 
241
}
}
243
242
244
243
table.oldernews {
table.oldernews {
245