Skip to content
This repository was archived by the owner on Oct 18, 2018. It is now read-only.

Commit aae829a

Browse files
committed
Bug fixes
1 parent f01f180 commit aae829a

13 files changed

+589
-291
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**
2+
!.gitignore
3+
!README.txt
4+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using GroupDocs.Annotation.Domain;
2+
using GroupDocs.Annotation.Domain.Results;
3+
using GroupDocs.Annotation.Handler;
4+
using GroupDocs.Annotation.Handler.Input.DataObjects;
5+
using GroupDocs.Annotation_for.NET.Models;
6+
using Newtonsoft.Json;
7+
using Newtonsoft.Json.Serialization;
8+
using System;
9+
using System.Collections.Generic;
10+
using System.Linq;
11+
using System.Web;
12+
using System.Web.Mvc;
13+
14+
namespace GroupDocs.Annotation_for.NET.Controllers
15+
{
16+
[RoutePrefix("files")]
17+
public class FilesController : Controller
18+
{
19+
// GET: Document
20+
[Route("")]
21+
public ActionResult Get(string file)
22+
{
23+
Response.AddHeader("Content-Type", "application/json");
24+
return Content("[\"Test - Copy.pdf\"]");
25+
}
26+
}
27+
}

GroupDocs.Annotation for .NET/Controllers/PageImageController.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public ActionResult Get(string file)
2222

2323
ImageOptions o = new ImageOptions();
2424
int pageNumber = int.Parse(Request.Params["page"]);
25-
o.PageNumbersToConvert = new List<int>(pageNumber - 1);
26-
o.PageNumber = pageNumber - 1;
25+
o.PageNumbersToConvert = new List<int>(pageNumber);
26+
o.PageNumber = pageNumber;
2727
o.CountPagesToConvert = 1;
2828
if (!string.IsNullOrEmpty(Request.Params["width"]))
2929
{
@@ -36,7 +36,7 @@ public ActionResult Get(string file)
3636

3737
Stream stream = null;
3838
List<PageImage> list = handler.GetPages(file, o);
39-
foreach (PageImage pageImage in list.Where(x => x.PageNumber == pageNumber - 1))
39+
foreach (PageImage pageImage in list.Where(x => x.PageNumber == pageNumber))
4040
{
4141
stream = pageImage.Stream;
4242
};
@@ -52,4 +52,5 @@ public ActionResult Get(string file)
5252

5353
}
5454
}
55-
}
55+
}
56+

GroupDocs.Annotation for .NET/GroupDocs.Annotation for .NET.csproj

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -139,34 +139,15 @@
139139
<Content Include="App_Data\Storage\Test - Copy.pdf" />
140140
<Content Include="App_Data\Storage\candy.pdf" />
141141
<None Include="Views\Home\index2.cshtml" />
142-
<Content Include="js\app.config.js" />
143-
<Content Include="js\app.controller.pageCanvas.js" />
144-
<Content Include="js\app.controller.thread.js" />
145-
<Content Include="js\app.controller.tools.js" />
146-
<Content Include="js\app.directive.gdxAnnoPage.js" />
147-
<Content Include="js\app.factory.annotation.js" />
148-
<Content Include="js\app.factory.replies.js" />
149-
<Content Include="js\app.factory.reply.js" />
150-
<Content Include="js\app.js" />
151-
<Content Include="css\style.css" />
142+
<Content Include="js\*.js" />
143+
<Content Include="css\*.css" />
152144
<None Include="Views\Home\index.cshtml" />
153145
<Content Include="Web.config" />
154146
</ItemGroup>
155147
<ItemGroup>
156148
<Compile Include="App_Start\RouteConfig.cs" />
157149
<Compile Include="App_Start\WebApiConfig.cs" />
158-
<Compile Include="Controllers\AddAnnotationController.cs" />
159-
<Compile Include="Controllers\AnnotationController.cs" />
160-
<Compile Include="Controllers\DeleteAnnotationController.cs" />
161-
<Compile Include="Controllers\DocumentInfoController.cs" />
162-
<Compile Include="Controllers\DownloadAnnotatedController.cs" />
163-
<Compile Include="Controllers\HomeController.cs" />
164-
<Compile Include="Controllers\ListAnnotationsController.cs" />
165-
<Compile Include="Controllers\PageCountController.cs" />
166-
<Compile Include="Controllers\PageImageController.cs" />
167-
<Compile Include="Controllers\PageTextController.cs" />
168-
<Compile Include="Controllers\RepliesController.cs" />
169-
<Compile Include="Controllers\ReplyController.cs" />
150+
<Compile Include="Controllers\*.cs" />
170151
<Compile Include="Global.asax.cs">
171152
<DependentUpon>Global.asax</DependentUpon>
172153
</Compile>
@@ -235,4 +216,6 @@
235216
<Target Name="AfterBuild">
236217
</Target>
237218
-->
238-
</Project>
219+
</Project>
220+
221+

GroupDocs.Annotation for .NET/Views/Home/index.cshtml

Lines changed: 184 additions & 169 deletions
Large diffs are not rendered by default.

GroupDocs.Annotation for .NET/css/style.css

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,32 @@
33
border: 2px solid blue;
44
}
55

6-
.rectangle:hover {
7-
background-color: rgba(0, 0, 200, 0.5);
8-
border: 1px dotted black;
9-
cursor: pointer;
10-
}
6+
.rectangle:hover {
7+
background-color: rgba(0, 0, 200, 0.5);
8+
border: 1px dotted black;
9+
cursor: pointer;
10+
}
1111

1212
.point {
1313
color: red;
1414
}
1515

16-
.point:hover {
17-
background-color: rgba(0, 0, 200, 0.5);
18-
cursor: pointer;
16+
.point:hover {
17+
background-color: rgba(0, 0, 200, 0.5);
18+
cursor: pointer;
19+
}
20+
21+
.arrow {
22+
background-color: rgba(0, 0, 0, 0);
23+
border: 2px solid blue;
1924
}
2025

26+
.arrow:hover {
27+
background-color: rgba(0, 0, 200, 0.5);
28+
border: 1px dotted black;
29+
cursor: pointer;
30+
}
31+
2132
gdx-anno-page {
2233
position: relative;
2334
margin: 0 auto;
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
(function () {
2+
'use strict';
3+
4+
var ANNOTATION_TYPE_AREA = 1;
5+
6+
angular.module('GroupDocsAnnotationApp')
7+
.factory('DocumentInfoFactory', DocumentInfoFactory)
8+
.factory('AnnotationListFactory', AnnotationListFactory)
9+
.factory('AnnotationAddFactory', AnnotationAddFactory)
10+
.controller('AvailableFilesController', AvailableFilesController)
11+
.controller('ToolbarController', ToolbarController)
12+
;
13+
14+
function DocumentInfoFactory($rootScope, $resource) {
15+
return $resource('/document/info?file=:filename', {}, {
16+
get: {
17+
method: 'GET'
18+
}
19+
});
20+
}
21+
22+
function AnnotationListFactory($rootScope, $resource) {
23+
return $resource('/annotation/list?file=:filename', {}, {
24+
query: {
25+
method: 'GET',
26+
isArray: true
27+
}
28+
});
29+
}
30+
31+
function AnnotationAddFactory($rootScope, $resource) {
32+
return $resource('/annotation/add?file=:filename', {}, {
33+
save: {
34+
method: 'POST'
35+
}
36+
});
37+
}
38+
39+
function AvailableFilesController($scope, FilesFactory) {
40+
$scope.list = FilesFactory.query();
41+
}
42+
43+
function ToolbarController($scope, $mdToast) {
44+
45+
$scope.$on('annotation-added', function (event, args) {
46+
$mdToast.show(
47+
$mdToast.simple().textContent('Annotation added')
48+
);
49+
});
50+
51+
$scope.$on('annotation-deleted', function (event, args) {
52+
$mdToast.show(
53+
$mdToast.simple().textContent('Annotation deleted')
54+
);
55+
});
56+
}
57+
58+
})();
59+
Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
(function () {
22
'use strict';
33

4-
function main($rootScope, $scope, AnnotationListFactory, FilesFactory, DocumentInfoFactory) {
5-
6-
$scope.docInfo = DocumentInfoFactory.get();
7-
$scope.selectedFile = FilesFactory.selectedFile;
8-
$scope.annotationsList = AnnotationListFactory.query();
9-
$rootScope.selectedDrawingTool = 'select';
4+
function main($rootScope, $scope, AnnotationListFactory, DocumentInfoFactory) {
5+
6+
$rootScope.$watch('selectedFile', function () {
7+
if (typeof($rootScope.selectedFile) !== 'string' || !$rootScope.selectedFile.length) {
8+
return;
9+
}
10+
11+
$rootScope.docInfo = DocumentInfoFactory.get({
12+
filename: $rootScope.selectedFile
13+
});
14+
$rootScope.annotationsList = AnnotationListFactory.query({
15+
filename: $rootScope.selectedFile
16+
});
17+
});
18+
19+
$rootScope.$watch('selectedFile', function () {
20+
$rootScope.selectedDrawingTool = 'select';
21+
$rootScope.selectedAnnotationGuid = null;
22+
});
1023
}
24+
1125
angular.module('GroupDocsAnnotationApp').controller('PageCanvasController', main);
1226
})();
1327

GroupDocs.Annotation for .NET/js/app.controller.tools.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
$scope.selectRectangleTool = function ($event) {
77
$rootScope.selectedDrawingTool = 'rectangle';
88
};
9+
$scope.selectDistanceTool = function ($event) {
10+
$rootScope.selectedDrawingTool = 'distance';
11+
};
912
$scope.selectArrowTool = function ($event) {
1013
$rootScope.selectedDrawingTool = 'arrow';
1114
};
@@ -18,6 +21,12 @@
1821
$scope.selectPointTool = function ($event) {
1922
$rootScope.selectedDrawingTool = 'point';
2023
};
24+
$scope.selectUnderlineTool = function ($event) {
25+
$rootScope.selectedDrawingTool = 'underline';
26+
};
27+
$scope.selectStrikeoutTool = function ($event) {
28+
$rootScope.selectedDrawingTool = 'strikeout';
29+
};
2130

2231
$scope.selectSelectTool();
2332
}

0 commit comments

Comments
 (0)