1define("app/expertise-details/contradictory/contradictory-controller", ['common/models/expertise/expertise-service'], function($__0) { 2 "use strict"; 3 var __moduleName = "app/expertise-details/contradictory/contradictory-controller"; 4 function require(path) { 5 return $traceurRuntime.require("app/expertise-details/contradictory/contradictory-controller", path); 6 } 7 if (!$__0 || !$__0.__esModule) 8 $__0 = {default: $__0}; 9 $__0; 10 angular.module('op.expertiseDetails.contradictory', ['oo.i18n', 'op.models.expertise', 'oui.fileIcons', 'oo.http']); 11 var ContradictoryCtrl = function ContradictoryCtrl($scope, expertise, $fileIcons, _, $ooHttp, $i18n, $element, $http, OPLX_ENV) { 12 var vm = this, 13 expertiseId = $scope.getSidePanelParams('expertiseId'); 14 vm.currentExpertise; 15 vm.displayState = 'loading'; 16 vm.contradictoryLists; 17 var OPLX_BACKEND_V2_ENDPOINT = OPLX_ENV.OPLX_BACKEND_V2_ENDPOINT; 18 function itemSort(list, element, isAsc) { 19 return _(list).chain().sortBy(element).tap(function(s) { 20 !isAsc && s.reverse(); 21 }).value(); 22 } 23 function _sort(item, isAsc) { 24 vm.contradictoryLists && (vm.contradictoryLists.seen = itemSort(vm.contradictoryLists.seen, item, isAsc)); 25 vm.contradictoryLists && (vm.contradictoryLists.unseen = itemSort(vm.contradictoryLists.unseen, item, isAsc)); 26 } 27 vm.sorts = [{ 28 name: 'name', 29 text: 'i18n:op.item.fileName', 30 sort: function(isAsc) { 31 _sort('fileName', isAsc); 32 } 33 }, { 34 name: 'date', 35 text: 'i18n:op.item.depositeDate', 36 sort: function(isAsc) { 37 _sort('uploadedDate', isAsc); 38 } 39 }, { 40 name: 'depositary', 41 text: 'i18n:op.item.depositaryName', 42 sort: function(isAsc) { 43 _sort('depositaryName', isAsc); 44 } 45 }, { 46 name: 'directory', 47 text: 'i18n:op.contradictory.parent', 48 sort: function(isAsc) { 49 _sort('parentName', isAsc); 50 } 51 }]; 52 vm.currentSort = vm.sorts[0]; 53 vm.sortAsc = true; 54 $scope.$watchGroup([function() { 55 return vm.contradictoryLists; 56 }, function() { 57 return vm.sortName; 58 }, function() { 59 return vm.sortAsc; 60 }], function() { 61 vm.currentSort && vm.currentSort.sort(vm.sortAsc); 62 }); 63 $scope.$watch(function() { 64 return $element.parents('.oo-sp-page').scope().currentPage.name; 65 }, function(name) { 66 name.match('contradictory') && reloadContradictory(); 67 }); 68 vm.getIcon = function(filename) { 69 return $fileIcons.fileIconPath(filename, 32); 70 }; 71 vm.getRole = function(enumRole) { 72 return ("(" + $i18n('op.' + enumRole.toLowerCase()) + ")"); 73 }; 74 vm.contradictoryDetails = function(item) { 75 try { 76 $http.get(item._links.self.href).then((function(item) { 77 $scope.openSidePanel('sp-contradictory-details', {params: {item: item.data}}); 78 })); 79 } catch (e) {} 80 }; 81 function reloadContradictory() { 82 expertise.find(expertiseId).then((function(e) { 83 vm.currentExpertise = e; 84 try { 85 $http.get(OPLX_BACKEND_V2_ENDPOINT + e._links.contradictory.href).then((function(c) { 86 vm.contradictoryLists = c.data; 87 vm.displayState = 'ready'; 88 })); 89 } catch (err) { 90 $scope.close(); 91 } 92 }), (function() { 93 $scope.close(); 94 })); 95 } 96 }; 97 ($traceurRuntime.createClass)(ContradictoryCtrl, {}, {}); 98 angular.module('op.expertiseDetails.contradictory').controller('ContradictoryCtrl', ContradictoryCtrl); 99 return {}; 100});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.