Home | History | Annotate | Download | only in static

Lines Matching refs:scope

4  * them into $scope.categories and $scope.testData .
25 // than calling $scope.isValueInSet().
26 // Besides, I don't think we have access to $scope in here...
43 function($scope, $http, $filter, $location, $timeout) {
44 $scope.windowTitle = "Loading GM Results...";
45 $scope.resultsToLoad = $location.search().resultsToLoad;
46 $scope.loadingMessage = "Loading results of type '" + $scope.resultsToLoad +
54 $http.get("/results/" + $scope.resultsToLoad).success(
57 $scope.loadingMessage =
59 $scope.localTimeString(data.header.timeNextUpdateAvailable);
64 $scope.loadingMessage = "Processing data, please wait...";
66 $scope.header = data.header;
67 $scope.categories = data.categories;
68 $scope.testData = data.testData;
69 $scope.sortColumn = 'weightedDiffMeasure';
70 $scope.showTodos = false;
72 $scope.showSubmitAdvancedSettings = false;
73 $scope.submitAdvancedSettings = {};
74 $scope.submitAdvancedSettings['reviewed-by-human'] = true;
75 $scope.submitAdvancedSettings['ignore-failure'] = false;
76 $scope.submitAdvancedSettings['bug'] = '';
80 $scope.tabs = [
84 $scope.tabs = $scope.tabs.concat(
87 $scope.defaultTab = $scope.tabs[0];
88 $scope.viewingTab = $scope.defaultTab;
91 $scope.numResultsPerTab = {};
92 for (var i = 0; i < $scope.tabs.length; i++) {
93 $scope.numResultsPerTab[$scope.tabs[i]] = 0;
95 $scope.numResultsPerTab[$scope.defaultTab] = $scope.testData.length;
98 for (var i = 0; i < $scope.testData.length; i++) {
99 $scope.testData[i].index = i;
100 $scope.testData[i].tab = $scope.defaultTab;
104 $scope.selectedItems = [];
107 $scope.hiddenResultTypes = {
112 $scope.allResultTypes = Object.keys(data.categories['resultType']);
113 $scope.hiddenConfigs = {};
114 $scope.allConfigs = Object.keys(data.categories['config']);
117 $scope.categoryValueMatch = {};
118 $scope.categoryValueMatch.builder = "";
119 $scope.categoryValueMatch.test = "";
122 $scope.queryParameters.load();
124 $scope.updateResults();
125 $scope.loadingMessage = "";
126 $scope.windowTitle = "Current GM Results";
131 $scope.loadingMessage = "Failed to load results of type '"
132 + $scope.resultsToLoad + "'";
133 $scope.windowTitle = "Failed to Load GM Results";
145 $scope.selectAllItems = function() {
146 var numItemsShowing = $scope.limitedTestData.length;
148 var index = $scope.limitedTestData[i].index;
149 if (!$scope.isValueInArray(index, $scope.selectedItems)) {
150 $scope.toggleValueInArray(index, $scope.selectedItems);
158 $scope.clearAllItems = function() {
159 var numItemsShowing = $scope.limitedTestData.length;
161 var index = $scope.limitedTestData[i].index;
162 if ($scope.isValueInArray(index, $scope.selectedItems)) {
163 $scope.toggleValueInArray(index, $scope.selectedItems);
171 $scope.toggleAllItems = function() {
172 var numItemsShowing = $scope.limitedTestData.length;
174 var index = $scope.limitedTestData[i].index;
175 $scope.toggleValueInArray(index, $scope.selectedItems);
189 $scope.setViewingTab = function(tab) {
190 $scope.viewingTab = tab;
191 $scope.updateResults();
195 * Move the items in $scope.selectedItems to a different tab,
196 * and then clear $scope.selectedItems.
200 $scope.moveSelectedItemsToTab = function(newTab) {
201 $scope.moveItemsToTab($scope.selectedItems, newTab);
202 $scope.selectedItems = [];
203 $scope.updateResults();
207 * Move a subset of $scope.testData to a different tab.
209 * @param itemIndices (array of ints): indices into $scope.testData
213 $scope.moveItemsToTab = function(itemIndices, newTab) {
218 $scope.numResultsPerTab[$scope.testData[itemIndex].tab]--;
219 $scope.testData[itemIndex].tab = newTab;
221 $scope.numResultsPerTab[newTab] += numItems;
226 // $scope.queryParameters:
227 // Transfer parameter values between $scope and the URL query string.
229 $scope.queryParameters = {};
232 // (load a parameter value into $scope from nameValuePairs,
233 // save a parameter value from $scope into nameValuePairs)
234 $scope.queryParameters.copiers = {
239 $scope[name] = value;
243 nameValuePairs[name] = $scope[name];
251 $scope.categoryValueMatch[name] = value;
255 nameValuePairs[name] = $scope.categoryValueMatch[name];
264 $scope[name] = {};
265 $scope.toggleValuesInSet(valueArray, $scope[name]);
269 nameValuePairs[name] = Object.keys($scope[name]).join(',');
276 $scope.queryParameters.map = {
277 'resultsToLoad': $scope.queryParameters.copiers.simple,
278 'displayLimitPending': $scope.queryParameters.copiers.simple,
279 'imageSizePending': $scope.queryParameters.copiers.simple,
280 'sortColumn': $scope.queryParameters.copiers.simple,
282 'builder': $scope.queryParameters.copiers.categoryValueMatch,
283 'test': $scope.queryParameters.copiers.categoryValueMatch,
285 'hiddenResultTypes': $scope.queryParameters.copiers.set,
286 'hiddenConfigs': $scope.queryParameters.copiers.set,
289 // Loads all parameters into $scope from the URL query string;
291 $scope.queryParameters.load = function() {
293 angular.forEach($scope.queryParameters.map,
300 // Saves all parameters from $scope into the URL query string.
301 $scope.queryParameters.save = function() {
303 angular.forEach($scope.queryParameters.map,
317 * Set $scope.areUpdatesPending (to enable/disable the Update Results
327 * @param val boolean value to set $scope.areUpdatesPending to
329 $scope.setUpdatesPending = function(val) {
330 $scope.areUpdatesPending = val;
335 * and call $scope.queryParameters.save() so that the new filter results
338 $scope.updateResults = function() {
339 $scope.displayLimit = $scope.displayLimitPending;
345 if ($scope.viewingTab == $scope.defaultTab) {
350 ($scope.sortColumn == 'percentDifferingPixels') ||
351 ($scope.sortColumn == 'weightedDiffMeasure'));
353 $scope.filteredTestData =
356 $scope.testData,
357 $scope.hiddenResultTypes,
358 $scope.hiddenConfigs,
359 $scope.categoryValueMatch.builder,
360 $scope.categoryValueMatch.test,
361 $scope.viewingTab
363 $scope.sortColumn, doReverse);
364 $scope.limitedTestData = $filter("limitTo")(
365 $scope.filteredTestData, $scope.displayLimit);
367 $scope.filteredTestData =
370 $scope.testData,
371 {tab: $scope.viewingTab},
374 $scope.sortColumn);
375 $scope.limitedTestData = $scope.filteredTestData;
377 $scope.imageSize = $scope.imageSizePending;
378 $scope.setUpdatesPending(false);
379 $scope.queryParameters.save();
387 $scope.sortResultsBy = function(sortColumn) {
388 $scope.sortColumn = sortColumn;
389 $scope.updateResults();
393 * Set $scope.categoryValueMatch[name] = value, and update results.
398 $scope.setCategoryValueMatch = function(name, value) {
399 $scope.categoryValueMatch[name] = value;
400 $scope.updateResults();
404 * Update $scope.hiddenResultTypes so that ONLY this resultType is showing,
409 $scope.showOnlyResultType = function(resultType) {
410 $scope.hiddenResultTypes = {};
411 // TODO(epoger): Maybe change $scope.allResultTypes to be a Set like
412 // $scope.hiddenResultTypes (rather than an array), so this operation is
414 $scope.toggleValuesInSet($scope.allResultTypes, $scope.hiddenResultTypes);
415 $scope.toggleValueInSet(resultType, $scope.hiddenResultTypes);
416 $scope.updateResults();
420 * Update $scope.hiddenConfigs so that ONLY this config is showing,
425 $scope.showOnlyConfig = function(config) {
426 $scope.hiddenConfigs = {};
427 $scope.toggleValuesInSet($scope.allConfigs, $scope.hiddenConfigs);
428 $scope.toggleValueInSet(config, $scope.hiddenConfigs);
429 $scope.updateResults();
442 * $scope.testData (perhaps with some modifications)
444 $scope.submitApprovals = function(testDataSubset) {
445 $scope.submitPending = true;
449 var bugNumber = parseInt($scope.submitAdvancedSettings['bug']);
477 $scope.submitAdvancedSettings['reviewed-by-human'];
478 if (true == $scope.submitAdvancedSettings['ignore-failure']) {
489 $scope.submitPending = false;
496 oldResultsType: $scope.header.type,
497 oldResultsHash: $scope.header.dataHash,
505 $scope.moveItemsToTab(itemIndicesToMove,
507 $scope.updateResults();
513 $scope.submitPending = false;
517 $scope.submitPending = false;
537 $scope.isValueInSet = function(value, set) {
547 $scope.toggleValueInSet = function(value, set) {
561 $scope.toggleValuesInSet = function(valueArray, set) {
564 $scope.toggleValueInSet(valueArray[i], set);
581 $scope.isValueInArray = function(value, array) {
592 $scope.toggleValueInArray = function(value, array) {
613 $scope.localTimeString = function(secondsPastEpoch) {