42
42
function clear_bufs(before) {
43
43
if (!added.length && !removed.length) return;
44
45
var common = Math.min(added.length, removed.length);
45
46
for (var i = 0; i < common; i++) {
88
89
function toggle_unified_sbs(event) {
89
90
event.preventDefault();
90
var pts = Y.all(".pseudotable");
92
pts && pts.each(make_sbs);
92
Y.all(".pseudotable").each(make_sbs);
94
94
Y.get("#toggle_unified_sbs").set('innerHTML', "Show unified diffs");
97
pts && pts.each(make_unified);
97
Y.all(".pseudotable").each(make_unified);
99
99
Y.get("#toggle_unified_sbs").set('innerHTML', "Show diffs side-by-side");
143
143
'#collapse_all a'
146
function node_process(node) {
148
node.get('children').filter('.pseudotable').each(make_sbs);
152
function zoom_to_diff (path) {
153
var collapsable = Y.get('#' + path_to_id[path]).collapsable;
154
if (!collapsable.is_open) {
157
window.location.hash = '#' + path;
163
147
"domready", function () {
164
148
Y.all(".show_if_js").removeClass("show_if_js");
165
if (!specific_path) {
166
Y.all("#list-files a").on(
170
var path = decodeURIComponent(e.target.get('href').split('#')[1]);
171
window.location.hash = '#' + path;
175
var diffs = Y.all('.diff');
149
var diffs = Y.all('.diffBox');
176
150
if (diffs == null) return;
178
152
function(item, i)
180
var source_url = null;
182
source_url = global_path + '+filediff/' + link_data[item.get('id')];
183
item.query('.the-link').on(
187
collapsable.toggle();
189
var collapsable = new Collapsable(
191
expand_icon: item.query('.expand_diff'),
192
open_node: item.query('.diffinfo'),
195
is_open: specific_path != null,
196
loading: item.query('.loading'),
197
node_process: node_process
199
item.collapsable=collapsable;
201
if (window.location.hash && !specific_path) {
202
zoom_to_diff(window.location.hash.substring(1));
154
var item_slide = item.next('.diffinfo');
155
var expand_icon = item.query( '.expand_diff' );
156
var collapsable = new Collapsable(item_slide, expand_icon, [], [], true);
157
item.query('.expand_diff').on('click', function(){collapsable.toggle();});
158
item.collapsable=collapsable;