+ HistoryPerspective.prototype.makeDiff = function() {
+ var changelist = $('#changes-list');
+ var selected = $('.entry.selected', changelist);
+
+ if (selected.length != 2) {
+ window.alert("Musisz zaznaczyć dokładnie dwie wersje do porównania.");
+ return;
+ }
+
+ $.blockUI({
+ message: 'Wczytywanie porównania...'
+ });
+
+ var rev_from = $("*[data-stub-value='version']", selected[1]).text();
+ var rev_to = $("*[data-stub-value='version']", selected[0]).text();
+
+ return this.doc.fetchDiff({
+ from: rev_from,
+ to: rev_to,
+ success: function(doc, data){
+ var result = $.wiki.newTab(doc, ''+rev_from +' -> ' + rev_to, 'DiffPerspective');
+
+ $(result.view).html(data);
+ $.wiki.switchToTab(result.tab);
+ $.unblockUI();
+ },
+ failure: function(doc){
+ $.unblockUI();
+ }
+ });
+ };
+
+ $.wiki.HistoryPerspective = HistoryPerspective;
+