+ static open(revFrom, revTo) {
+ let tabId = 'R' + revFrom + '-' + revTo;
+ let tab = $(".tabs #DiffPerspective_" + tabId);
+ if (tab.length) {
+ $.wiki.switchToTab(tab);
+ } else {
+ let result = $.wiki.newTab(CurrentDocument, ''+revFrom +' → ' + revTo, 'DiffPerspective', tabId);
+ $.blockUI({
+ message: 'Wczytywanie porównania...'
+ });
+
+ CurrentDocument.fetchDiff({
+ from: revFrom,
+ to: revTo,
+ success: function(doc, data){
+ $(result.view).html(data);
+ $.wiki.switchToTab(result.tab);
+ $.unblockUI();
+ },
+ failure: function(doc){
+ $.unblockUI();
+ }
+ });
+ return result.tab;
+ }
+ }