Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: gm/rebaseline_server/static/loader.js

Issue 26659002: rebaseline_server: extend returned JSON dict to allow for result-editing in coming CL (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Loader: 2 * Loader:
3 * Reads GM result reports written out by results.py, and imports 3 * Reads GM result reports written out by results.py, and imports
4 * them into $scope.categories and $scope.testData . 4 * them into $scope.categories and $scope.testData .
5 */ 5 */
6 var Loader = angular.module( 6 var Loader = angular.module(
7 'Loader', 7 'Loader',
8 [] 8 []
9 ); 9 );
10 10
(...skipping 16 matching lines...) Expand all
27 return filteredItems; 27 return filteredItems;
28 }; 28 };
29 } 29 }
30 ); 30 );
31 31
32 Loader.controller( 32 Loader.controller(
33 'Loader.Controller', 33 'Loader.Controller',
34 function($scope, $http, $filter) { 34 function($scope, $http, $filter) {
35 $http.get("/results/all").then( 35 $http.get("/results/all").then(
36 function(response) { 36 function(response) {
37 $scope.header = response.data.header;
37 $scope.categories = response.data.categories; 38 $scope.categories = response.data.categories;
38 $scope.testData = response.data.testData; 39 $scope.testData = response.data.testData;
39 $scope.sortColumn = 'test'; 40 $scope.sortColumn = 'test';
40 41
41 $scope.hiddenResultTypes = [ 42 $scope.hiddenResultTypes = [
42 'failure-ignored', 'no-comparison', 'succeeded']; 43 'failure-ignored', 'no-comparison', 'succeeded'];
43 $scope.hiddenConfigs = []; 44 $scope.hiddenConfigs = [];
45 $scope.selectedItems = [];
jcgregorio 2013/10/09 14:41:48 Making this an {} would simplify the code since yo
epoger 2013/10/09 15:35:30 Great idea! Done.
44 46
45 $scope.updateResults(); 47 $scope.updateResults();
46 } 48 }
47 ); 49 );
48 50
51 $scope.isItemSelected = function(index) {
52 return ($scope.selectedItems.indexOf(index) >= 0);
jcgregorio 2013/10/09 14:41:48 If you don't switch to using a map, then this shou
epoger 2013/10/09 15:35:30 Switched to map.
53 }
54 $scope.toggleItemSelected = function(index) {
55 var i = $scope.selectedItems.indexOf(index);
56 if (i >= 0) {
57 $scope.selectedItems.splice(i, 1);
58 } else {
59 $scope.selectedItems.push(index);
60 }
61 // unlike other toggle methods below, does not set
62 // $scope.areUpdatesPending = true;
63 }
64
49 $scope.isHiddenResultType = function(thisResultType) { 65 $scope.isHiddenResultType = function(thisResultType) {
50 return ($scope.hiddenResultTypes.indexOf(thisResultType) >= 0); 66 return ($scope.hiddenResultTypes.indexOf(thisResultType) >= 0);
51 } 67 }
52 $scope.toggleHiddenResultType = function(thisResultType) { 68 $scope.toggleHiddenResultType = function(thisResultType) {
53 var i = $scope.hiddenResultTypes.indexOf(thisResultType); 69 var i = $scope.hiddenResultTypes.indexOf(thisResultType);
54 if (i >= 0) { 70 if (i >= 0) {
55 $scope.hiddenResultTypes.splice(i, 1); 71 $scope.hiddenResultTypes.splice(i, 1);
56 } else { 72 } else {
57 $scope.hiddenResultTypes.push(thisResultType); 73 $scope.hiddenResultTypes.push(thisResultType);
58 } 74 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 $scope.imageSize = $scope.imageSizePending; 112 $scope.imageSize = $scope.imageSizePending;
97 $scope.areUpdatesPending = false; 113 $scope.areUpdatesPending = false;
98 } 114 }
99 115
100 $scope.sortResultsBy = function(sortColumn) { 116 $scope.sortResultsBy = function(sortColumn) {
101 $scope.sortColumn = sortColumn; 117 $scope.sortColumn = sortColumn;
102 $scope.updateResults(); 118 $scope.updateResults();
103 } 119 }
104 } 120 }
105 ); 121 );
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698