diff --git a/app.js b/app.js index d1ceb0890..d4311929b 100644 --- a/app.js +++ b/app.js @@ -464,29 +464,8 @@ spacialistApp.directive('fileList', function(fileService) { availableTags: '=', searchTerms: '=' }, - controller: 'fileCtrl' - }; -}); - -spacialistApp.directive('oldImageList', function(fileService) { - return { - restrict: 'E', - templateUrl: 'includes/image-list.html', - scope: { - onScrollLoad: '&', - scrollContainer: '=', - imageData: '=', - imageType: '=', - showTags: '=', - searchTerms: '=' - }, controller: 'fileCtrl', - link: function(scope, elements, attrs) { - scope.availableTags = fileService.availableTags; - scope.$root.$on('image:delete:linked', function(event, args) { - scope.tmpData.linked = []; - }); - } + controllerAs: '$ctrl' }; }); diff --git a/bibliography.html b/bibliography.html index f60e5a247..5c8bcad2d 100644 --- a/bibliography.html +++ b/bibliography.html @@ -6,13 +6,13 @@
search
- + - - @@ -21,45 +21,45 @@ - + {{'literature.bibtex.type'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up - + {{'literature.bibtex.author'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up - + {{'literature.bibtex.editor'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up - + {{'literature.bibtex.title'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up - + {{'literature.bibtex.journal'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up - + {{'literature.bibtex.year'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up @@ -84,24 +84,24 @@ {{'literature.bibtex.series'|translate}} - + {{'literature.bibtex.booktitle'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up - + {{'literature.bibtex.publisher'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up - + {{'literature.bibtex.address'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up @@ -114,17 +114,17 @@ {{'literature.updated-at'|translate}} - + {{'literature.bibtex.misc'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up - + {{'literature.bibtex.howpublished'|translate}} - arrow_drop_down - arrow_drop_up + arrow_drop_down + arrow_drop_up @@ -145,7 +145,7 @@ - + {{ entry.type }} @@ -219,7 +219,7 @@ {{ entry.school }} - diff --git a/controllers/bibliographyCtrl.js b/controllers/bibliographyCtrl.js index 1c0cb79b2..973a1015e 100644 --- a/controllers/bibliographyCtrl.js +++ b/controllers/bibliographyCtrl.js @@ -1,18 +1,19 @@ -spacialistApp.controller('bibliographyCtrl', function($scope, literatureService) { - $scope.sortType = 'author'; - $scope.sortReverse = false; - $scope.searchTerm = ''; - var localBibliography = this.bibliography; +spacialistApp.controller('bibliographyCtrl', function(literatureService) { + var vm = this; - $scope.openAddLiteratureDialog = function() { - literatureService.openAddLiteratureDialog(localBibliography); + vm.sortType = 'author'; + vm.sortReverse = false; + vm.searchTerm = ''; + + vm.openAddLiteratureDialog = function() { + literatureService.openAddLiteratureDialog(vm.bibliography); }; - $scope.importBibTexFile = function(file, invalidFiles) { - literatureService.importBibTexFile(file, invalidFiles, localBibliography); + vm.importBibTexFile = function(file, invalidFiles) { + literatureService.importBibTexFile(file, invalidFiles, vm.bibliography); }; - $scope.deleteLiteratureEntry = function(entry) { - literatureService.deleteLiteratureEntry(entry, localBibliography); - } + vm.deleteLiteratureEntry = function(entry) { + literatureService.deleteLiteratureEntry(entry, vm.bibliography); + }; }); diff --git a/controllers/dataEditorCtrl.js b/controllers/dataEditorCtrl.js index e0bb04d7f..a519e5eb5 100644 --- a/controllers/dataEditorCtrl.js +++ b/controllers/dataEditorCtrl.js @@ -1,31 +1,31 @@ -spacialistApp.controller('dataEditorCtrl', ['$scope', 'dataEditorService', 'mainService', function($scope, dataEditorService, mainService) { +spacialistApp.controller('dataEditorCtrl', ['dataEditorService', 'mainService', function(dataEditorService, mainService) { var vm = this; - $scope.addNewAttribute = function() { + vm.addNewAttribute = function() { dataEditorService.addNewAttributeWindow(vm.attributetypes, vm.attributes); }; - $scope.onDeleteAttribute = function(attr) { + vm.onDeleteAttribute = function(attr) { dataEditorService.deleteAttribute(attr, vm.attributes); }; - $scope.addNewContextType = function() { + vm.addNewContextType = function() { dataEditorService.addNewContextTypeWindow(vm.geometryTypes, vm.contextTypes); }; - $scope.editContextType = function(e) { + vm.editContextType = function(e) { dataEditorService.editContextType(e); }; - $scope.deleteContextType = function(e) { + vm.deleteContextType = function(e) { dataEditorService.deleteContextType(e, vm.contextTypes, vm.concepts[e.thesaurus_url].label); }; - $scope.onRemoveAttrFromCt = function(attr) { + vm.onRemoveAttrFromCt = function(attr) { dataEditorService.removeAttributeFromContextType(vm.contextType, attr, vm.fields); }; - $scope.onOrderAttrOfCt = { + vm.onOrderAttrOfCt = { up: function(attr) { dataEditorService.moveAttributeOfContextTypeUp(attr, vm.fields); }, @@ -34,7 +34,7 @@ spacialistApp.controller('dataEditorCtrl', ['$scope', 'dataEditorService', 'main } }; - $scope.addAttributeToContextType = function() { + vm.addAttributeToContextType = function() { dataEditorService.addAttributeToContextTypeWindow(vm.contextType, vm.fields, vm.attributes, vm.concepts); }; }]); diff --git a/controllers/fileCtrl.js b/controllers/fileCtrl.js index 4e0aaf45a..106a869ad 100644 --- a/controllers/fileCtrl.js +++ b/controllers/fileCtrl.js @@ -1,17 +1,19 @@ -spacialistApp.controller('fileCtrl', ['$scope', 'fileService', 'mainService', 'snackbarService', '$translate', function($scope, fileService, mainService, snackbarService, $translate) { - $scope.getMimeType = fileService.getMimeType; +spacialistApp.controller('fileCtrl', ['fileService', 'mainService', 'snackbarService', '$translate', function(fileService, mainService, snackbarService, $translate) { + var vm = this; - $scope.search = { + vm.getMimeType = fileService.getMimeType; + + vm.search = { terms: { tags: [] } }; - $scope.addTag = function(file, item) { + vm.addTag = function(file, item) { fileService.addTag(file, item); }; - $scope.removeTag = function(file, item) { + vm.removeTag = function(file, item) { fileService.removeTag(file, item); }; }]); diff --git a/controllers/layerEditorCtrl.js b/controllers/layerEditorCtrl.js index 2c1b4038a..8a25b6007 100644 --- a/controllers/layerEditorCtrl.js +++ b/controllers/layerEditorCtrl.js @@ -1,15 +1,15 @@ -spacialistApp.controller('layerEditorCtrl', ['$scope', 'layerEditorService', function($scope, layerEditorService) { - var localLayers = this.avLayers; +spacialistApp.controller('layerEditorCtrl', ['layerEditorService', function(layerEditorService) { + var vm = this; - $scope.addNewBaselayer = function() { - layerEditorService.addNewBaselayer(localLayers); + vm.addNewBaselayer = function() { + layerEditorService.addNewBaselayer(vm.avLayers); }; - $scope.addNewOverlay = function() { - layerEditorService.addNewOverlay(localLayers); + vm.addNewOverlay = function() { + layerEditorService.addNewOverlay(vm.avLayers); }; - $scope.onDelete = function(l) { - layerEditorService.onDelete(l, localLayers); + vm.onDelete = function(l) { + layerEditorService.onDelete(l, vm.avLayers); }; }]); diff --git a/controllers/mainCtrl.js b/controllers/mainCtrl.js index c66286371..8544ec61e 100644 --- a/controllers/mainCtrl.js +++ b/controllers/mainCtrl.js @@ -18,10 +18,6 @@ spacialistApp.controller('mainCtrl', ['$scope', 'mainService', 'mapService', 'fi vm.currentElement.form.$setPristine(); }; - vm.onSourceAdd = function(entry) { - console.log(entry); - }; - if(vm.tab == 'map') { mapService.setupLayers(vm.layer, vm.map, vm.contexts, vm.concepts); mapService.initMapObject().then(function(obj) { @@ -144,7 +140,7 @@ spacialistApp.controller('mainCtrl', ['$scope', 'mainService', 'mapService', 'fi ] ]; - $scope.hasSources = function(element) { + vm.hasSources = function(element) { return Object.keys(element.sources).length > 0; }; diff --git a/controllers/pdfCtrl.js b/controllers/pdfCtrl.js index 16ac4dd5a..ee050337a 100644 --- a/controllers/pdfCtrl.js +++ b/controllers/pdfCtrl.js @@ -1,43 +1,16 @@ -spacialistApp.controller('pdfCtrl', ['$scope', 'httpGetFactory', 'pdfDelegate', function($scope, httpGetFactory, pdfDelegate) { +spacialistApp.controller('pdfCtrl', ['$scope', 'httpGetFactory', function($scope, httpGetFactory) { $scope.fileLoaded = false; $scope.isPreview = false; - - var pdfHandle = 'pdf-handle'; - var pdfDelegateHandle = pdfDelegate.$getByHandle(pdfHandle); + $scope.status = { + progress: 0 + }; $scope.togglePreview = function() { $scope.isPreview = !$scope.isPreview; }; - // Delegate functions - $scope.prev = function() { - return pdfDelegateHandle.prev(); - }; - $scope.next = function() { - return pdfDelegateHandle.next(); - }; - $scope.zoomIn = function(amount) { - return pdfDelegateHandle.zoomIn(amount); - }; - $scope.zoomOut = function(amount) { - return pdfDelegateHandle.zoomOut(amount); - }; - $scope.zoomTo = function(amount) { - return pdfDelegateHandle.zoomTo(amount); - }; - $scope.rotate = function() { - return pdfDelegateHandle.rotate(); - }; - $scope.getPageCount = function() { - return pdfDelegateHandle.getPageCount(); - }; - $scope.getCurrentPage = function() { - return pdfDelegateHandle.getCurrentPage(); - }; - $scope.goToPage = function(pageNumber) { - return pdfDelegateHandle.goToPage(pageNumber); - }; - $scope.load = function() { - return pdfDelegateHandle.load(); + $scope.onProgress = function(event) { + $scope.status.progress = Math.round(event.loaded / event.total * 100); + $scope.$apply(); }; }]); diff --git a/css/style.css b/css/style.css index 964de30fb..d773823d4 100644 --- a/css/style.css +++ b/css/style.css @@ -317,6 +317,14 @@ div[resizeable] { max-height: 100%; } +/* PDF viewer styles */ +.rotate0 {transform: rotate(0deg); } +.rotate90 {transform: rotate(90deg); } +.rotate180 {transform: rotate(180deg); } +.rotate270 {transform: rotate(270deg); } +.pdf-controls { width: 100%; display: block; background: #eee; padding: 1em;} +.fixed { position: fixed; top: 0; left: calc(50% - 480px); z-index: 100; width: 100%; padding: 1em; background: rgba(238, 238, 238,.9); width: 960px; } + .delete-icon { color: gray; font-size: 0.75em; diff --git a/data-model.html b/data-model.html index 4968bb234..234a95b2b 100644 --- a/data-model.html +++ b/data-model.html @@ -7,10 +7,10 @@

Die Label der Eltern-Elemente (relevant für Dropdown-Elemente) können angezeigt werden, indem man mit der Maus über das Label des entsprechenden Attributs fährt.

- + - @@ -18,7 +18,7 @@

diff --git a/index.html b/index.html index 1791856a8..ca11f79d7 100644 --- a/index.html +++ b/index.html @@ -48,7 +48,7 @@ - + diff --git a/layer-editor.html b/layer-editor.html index 74f9324af..be863f171 100644 --- a/layer-editor.html +++ b/layer-editor.html @@ -9,7 +9,7 @@
map {{ l.name }}
- + delete
@@ -24,7 +24,7 @@
-
@@ -35,7 +35,7 @@
- + delete
@@ -50,7 +50,7 @@
- diff --git a/layouts/pdf.html b/layouts/pdf.html new file mode 100644 index 000000000..67eaaea35 --- /dev/null +++ b/layouts/pdf.html @@ -0,0 +1,22 @@ + + diff --git a/lumen/app/Http/Controllers/ImageController.php b/lumen/app/Http/Controllers/ImageController.php index c4ed8b9dc..1d16c76b4 100644 --- a/lumen/app/Http/Controllers/ImageController.php +++ b/lumen/app/Http/Controllers/ImageController.php @@ -109,12 +109,6 @@ public function getImage($id) { return response()->json($this->getImageById($id)); } - public function getImageObject($id) { - $img = $this->getImageById($id); - $content = Storage::get($img->url); - return 'data:' . $img->mime_type . ';base64,' . base64_encode($content); - } - public function getAvailableTags() { $tags = DB::select(" WITH RECURSIVE diff --git a/lumen/app/Http/Controllers/OptionsController.php b/lumen/app/Http/Controllers/OptionsController.php deleted file mode 100644 index a141a1046..000000000 --- a/lumen/app/Http/Controllers/OptionsController.php +++ /dev/null @@ -1,20 +0,0 @@ - compact('token') ]; } - - private function validateToken() { - try { - if(!$user = JWTAuth::parseToken()->authenticate()) { - return [ - 'error' => 'user_not_found', - 'status' => 404 - ]; - } - } catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $e) { - return [ - 'error' => 'token_expired', - 'status' => 500 - ]; - } catch (Tymon\JWTAuth\Exceptions\TokenInvalidException $e) { - return [ - 'error' => 'token_invalid', - 'status' => 500 - ]; - } catch (Tymon\JWTAuth\Exceptions\JWTException $e) { - return [ - 'error' => 'token_absent', - 'status' => 500 - ]; - } - return [ - 'user' => $user, - 'status' => 200 - ]; - } } diff --git a/lumen/app/Http/routes.php b/lumen/app/Http/routes.php index 0d5978996..e1d355c13 100644 --- a/lumen/app/Http/routes.php +++ b/lumen/app/Http/routes.php @@ -68,7 +68,6 @@ ], function($app) { $app->get('', 'ImageController@getImages'); $app->get('{id:[0-9]+}', 'ImageController@getImage'); - $app->get('{id:[0-9]+}/object', 'ImageController@getImageObject'); $app->get('tag', 'ImageController@getAvailableTags'); $app->get('by_context/{id:[0-9]+}', 'ImageController@getByContext'); diff --git a/modals/file.html b/modals/file.html index b5cda2ccc..df4364f89 100644 --- a/modals/file.html +++ b/modals/file.html @@ -14,27 +14,12 @@

{{$ctrl.file.filename }}

-
- -
- +
+ +
+
+ {{ status.progress }}% +
diff --git a/package.json b/package.json index 842eaef42..8d130ef78 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "angular-highlightjs": "^0.7.1", "angular-marked": "^1.2.2", "angular-messages": "~1.5.8", - "angular-pdf-viewer": "git+https://github.com/winkerVSbecks/angular-pdf-viewer.git", + "angular-pdf": "^2.0.0", "angular-sanitize": "~1.5.8", "angular-simple-logger": "^0.1.7", "angular-translate": "^2.15.2", diff --git a/templates/context-type.html b/templates/context-type.html index 40649e832..d35c51a09 100644 --- a/templates/context-type.html +++ b/templates/context-type.html @@ -1,10 +1,10 @@

- +
-
diff --git a/templates/file-list.html b/templates/file-list.html index b4bcbac84..799258f26 100644 --- a/templates/file-list.html +++ b/templates/file-list.html @@ -8,7 +8,7 @@
-
+
@@ -53,7 +53,7 @@

- + {{ $item.label }} diff --git a/view.html b/view.html index e75f9db76..f003ac634 100644 --- a/view.html +++ b/view.html @@ -153,7 +153,7 @@