2015-02-07 19:49:04 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular.module('markdownFormatWdiffApp')
|
2015-02-10 02:19:47 +01:00
|
|
|
.controller('DocumentWdiffCtrl', function ($scope, $routeParams, $http, Auth, App) {
|
|
|
|
$scope.App = App;
|
2015-02-09 02:42:31 +01:00
|
|
|
$scope.wdiff = '';
|
|
|
|
$scope.title = '';
|
2015-02-07 19:49:04 +01:00
|
|
|
$scope.same = false;
|
|
|
|
$scope.revisionA = {};
|
|
|
|
$scope.revisionB = {};
|
2015-02-10 02:47:35 +01:00
|
|
|
$scope.isShowBefore = true;
|
|
|
|
$scope.isShowAfter = false;
|
2015-02-07 19:49:04 +01:00
|
|
|
|
|
|
|
$scope.getCurrentUser = Auth.getCurrentUser;
|
|
|
|
$scope.isLoggedIn = Auth.isLoggedIn;
|
|
|
|
|
|
|
|
|
|
|
|
var path = '/api/documents/wdiff/'+$routeParams.revisionida+'/'+$routeParams.revisionidb;
|
|
|
|
$http.get(path).success(function(result) {
|
|
|
|
$scope.result = result;
|
|
|
|
$scope.wdiff = result.wdiff;
|
|
|
|
$scope.revisionA = result.a;
|
|
|
|
$scope.revisionB = result.b;
|
2015-02-09 02:42:31 +01:00
|
|
|
|
|
|
|
$scope.title = result.a.document.title;
|
|
|
|
$scope.subtitle = "wdiff: "+result.a.created + " / " + result.b.created;
|
2015-02-07 19:49:04 +01:00
|
|
|
});
|
|
|
|
|
2015-02-10 02:47:35 +01:00
|
|
|
$scope.showBefore = function() {
|
|
|
|
$scope.isShowBefore = true;
|
|
|
|
$scope.isShowAfter = false;
|
|
|
|
}
|
|
|
|
$scope.showAfter = function() {
|
|
|
|
$scope.isShowBefore = false;
|
|
|
|
$scope.isShowAfter = true;
|
|
|
|
}
|
2015-02-07 19:49:04 +01:00
|
|
|
|
|
|
|
})
|