3 class DiffPerspective extends $.wiki.Perspective {
6 this.base_id = options.base_id;
10 let match = id.match(/R(\d+)-(\d+)/);
13 return this.open(match[1], match[2]);
16 static open(revFrom, revTo) {
17 let tabId = 'R' + revFrom + '-' + revTo;
18 let tab = $(".tabs #DiffPerspective_" + tabId);
20 $.wiki.switchToTab(tab);
22 let result = $.wiki.newTab(CurrentDocument, ''+revFrom +' → ' + revTo, 'DiffPerspective', tabId);
24 message: 'Wczytywanie porównania...'
27 CurrentDocument.fetchDiff({
30 success: function(doc, data){
31 $(result.view).html(data);
32 $.wiki.switchToTab(result.tab);
35 failure: function(doc){
44 $.wiki.switchToTab('#HistoryPerspective');
45 $('#' + this.base_id).remove();
46 $('#' + this.perspective_id).remove();
49 $.wiki.DiffPerspective = DiffPerspective;