Home | History | Annotate | Download | only in static

Lines Matching refs:scope

4  * them into $scope.extraColumnHeaders and $scope.imagePairs .
15 return function(scope, element, attrs) {
16 if (scope.$last) {
18 scope.resultsUpdatedCallback();
40 // than calling $scope.isValueInSet().
41 // Besides, I don't think we have access to $scope in here...
121 function($scope, $http, $filter, $location, $log, $timeout, constants) {
122 $scope.constants = constants;
123 $scope.windowTitle = "Loading GM Results...";
124 $scope.resultsToLoad = $location.search().resultsToLoad;
125 $scope.loadingMessage = "please wait...";
132 $http.get($scope.resultsToLoad).success(
137 $scope.loadingMessage = "ERROR: Got JSON file with schema version "
150 $scope.loadingMessage =
152 $scope.localTimeString(timeToReload / 1000);
157 $scope.loadingMessage = "processing data, please wait...";
159 $scope.header = dataHeader;
160 $scope.extraColumnHeaders = data[constants.KEY__ROOT__EXTRACOLUMNHEADERS];
161 $scope.imagePairs = data[constants.KEY__ROOT__IMAGEPAIRS];
162 $scope.imageSets = data[constants.KEY__ROOT__IMAGESETS];
163 $scope.sortColumnSubdict = constants.KEY__IMAGEPAIRS__DIFFERENCES;
164 $scope.sortColumnKey = constants.KEY__DIFFERENCES__PERCEPTUAL_DIFF;
166 $scope.showSubmitAdvancedSettings = false;
167 $scope.submitAdvancedSettings = {};
168 $scope.submitAdvancedSettings[
170 $scope.submitAdvancedSettings[
172 $scope.submitAdvancedSettings['bug'] = '';
176 $scope.tabs = [
180 $scope.tabs = $scope.tabs.concat(
183 $scope.defaultTab = $scope.tabs[0];
184 $scope.viewingTab = $scope.defaultTab;
187 $scope.numResultsPerTab = {};
188 for (var i = 0; i < $scope.tabs.length; i++) {
189 $scope.numResultsPerTab[$scope.tabs[i]] = 0;
191 $scope.numResultsPerTab[$scope.defaultTab] = $scope.imagePairs.length;
194 for (var i = 0; i < $scope.imagePairs.length; i++) {
195 $scope.imagePairs[i].index = i;
196 $scope.imagePairs[i].tab = $scope.defaultTab;
200 $scope.selectedImagePairs = [];
203 $scope.hiddenResultTypes = {};
204 $scope.hiddenResultTypes[
206 $scope.hiddenResultTypes[
208 $scope.hiddenResultTypes[
210 $scope.allResultTypes = $scope.columnSliceOf2DArray(
211 $scope.extraColumnHeaders[constants.KEY__EXTRACOLUMNS__RESULT_TYPE]
214 $scope.hiddenConfigs = {};
215 $scope.allConfigs = $scope.columnSliceOf2DArray(
216 $scope.extraColumnHeaders[constants.KEY__EXTRACOLUMNS__CONFIG]
221 $scope.categoryValueMatch = {};
222 $scope.categoryValueMatch.builder = "";
223 $scope.categoryValueMatch.test = "";
226 $scope.queryParameters.load();
232 $scope.imageSets,
237 imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl;
242 $scope.updateResults();
243 $scope.loadingMessage = "";
244 $scope.windowTitle = "Current GM Results";
249 $scope.loadingMessage = "FAILED to load.";
250 $scope.windowTitle = "Failed to Load GM Results";
262 $scope.selectAllImagePairs = function() {
263 var numImagePairsShowing = $scope.limitedImagePairs.length;
265 var index = $scope.limitedImagePairs[i].index;
266 if (!$scope.isValueInArray(index, $scope.selectedImagePairs)) {
267 $scope.toggleValueInArray(index, $scope.selectedImagePairs);
275 $scope.clearAllImagePairs = function() {
276 var numImagePairsShowing = $scope.limitedImagePairs.length;
278 var index = $scope.limitedImagePairs[i].index;
279 if ($scope.isValueInArray(index, $scope.selectedImagePairs)) {
280 $scope.toggleValueInArray(index, $scope.selectedImagePairs);
288 $scope.toggleAllImagePairs = function() {
289 var numImagePairsShowing = $scope.limitedImagePairs.length;
291 var index = $scope.limitedImagePairs[i].index;
292 $scope.toggleValueInArray(index, $scope.selectedImagePairs);
299 * @param startIndex index within $scope.limitedImagePairs of the first
303 $scope.toggleSomeImagePairs = function(startIndex, num) {
304 var numImagePairsShowing = $scope.limitedImagePairs.length;
306 var index = $scope.limitedImagePairs[i].index;
307 $scope.toggleValueInArray(index, $scope.selectedImagePairs);
321 $scope.setViewingTab = function(tab) {
322 $scope.viewingTab = tab;
323 $scope.updateResults();
327 * Move the imagePairs in $scope.selectedImagePairs to a different tab,
328 * and then clear $scope.selectedImagePairs.
332 $scope.moveSelectedImagePairsToTab = function(newTab) {
333 $scope.moveImagePairsToTab($scope.selectedImagePairs, newTab);
334 $scope.selectedImagePairs = [];
335 $scope.updateResults();
339 * Move a subset of $scope.imagePairs to a different tab.
341 * @param imagePairIndices (array of ints): indices into $scope.imagePairs
345 $scope.moveImagePairsToTab = function(imagePairIndices, newTab) {
350 $scope.numResultsPerTab[$scope.imagePairs[imagePairIndex].tab]--;
351 $scope.imagePairs[imagePairIndex].tab = newTab;
353 $scope.numResultsPerTab[newTab] += numImagePairs;
358 // $scope.queryParameters:
359 // Transfer parameter values between $scope and the URL query string.
361 $scope.queryParameters = {};
364 // (load a parameter value into $scope from nameValuePairs,
365 // save a parameter value from $scope into nameValuePairs)
366 $scope.queryParameters.copiers = {
371 $scope[name] = value;
375 nameValuePairs[name] = $scope[name];
383 $scope.categoryValueMatch[name] = value;
387 nameValuePairs[name] = $scope.categoryValueMatch[name];
396 $scope[name] = {};
397 $scope.toggleValuesInSet(valueArray, $scope[name]);
401 nameValuePairs[name] = Object.keys($scope[name]).join(',');
408 $scope.queryParameters.map = {
409 'resultsToLoad': $scope.queryParameters.copiers.simple,
410 'displayLimitPending': $scope.queryParameters.copiers.simple,
411 'showThumbnailsPending': $scope.queryParameters.copiers.simple,
412 'mergeIdenticalRowsPending': $scope.queryParameters.copiers.simple,
413 'imageSizePending': $scope.queryParameters.copiers.simple,
414 'sortColumnSubdict': $scope.queryParameters.copiers.simple,
415 'sortColumnKey': $scope.queryParameters.copiers.simple,
417 'hiddenResultTypes': $scope.queryParameters.copiers.set,
418 'hiddenConfigs': $scope.queryParameters.copiers.set,
420 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__BUILDER] =
421 $scope.queryParameters.copiers.categoryValueMatch;
422 scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__TEST] =
423 $scope.queryParameters.copiers.categoryValueMatch;
425 // Loads all parameters into $scope from the URL query string;
427 $scope.queryParameters.load = function() {
429 angular.forEach($scope.queryParameters.map,
436 // Saves all parameters from $scope into the URL query string.
437 $scope.queryParameters.save = function() {
439 angular.forEach($scope.queryParameters.map,
453 * Set $scope.areUpdatesPending (to enable/disable the Update Results
463 * @param val boolean value to set $scope.areUpdatesPending to
465 $scope.setUpdatesPending = function(val) {
466 $scope.areUpdatesPending = val;
471 * and call $scope.queryParameters.save() so that the new filter results
474 $scope.updateResults = function() {
475 $scope.renderStartTime = window.performance.now();
476 $log.debug("renderStartTime: " + $scope.renderStartTime);
477 $scope.displayLimit = $scope.displayLimitPending;
478 $scope.mergeIdenticalRows = $scope.mergeIdenticalRowsPending;
484 if ($scope.viewingTab == $scope.defaultTab) {
489 ($scope.sortColumnKey ==
491 ($scope.sortColumnKey ==
494 $scope.filteredImagePairs =
497 $scope.imagePairs,
498 $scope.hiddenResultTypes,
499 $scope.hiddenConfigs,
500 $scope.categoryValueMatch.builder,
501 $scope.categoryValueMatch.test,
502 $scope.viewingTab
504 [$scope.getSortColumnValue, $scope.getSecondOrderSortValue],
506 $scope.limitedImagePairs = $filter("mergeAndLimit")(
507 $scope.filteredImagePairs, $scope.displayLimit, $scope.mergeIdenticalRows);
509 $scope.filteredImagePairs =
512 $scope.imagePairs,
513 {tab: $scope.viewingTab},
516 [$scope.getSortColumnValue, $scope.getSecondOrderSortValue]);
517 $scope.limitedImagePairs = $filter("mergeAndLimit")(
518 $scope.filteredImagePairs, -1, $scope.mergeIdenticalRows);
520 $scope.showThumbnails = $scope.showThumbnailsPending;
521 $scope.imageSize = $scope.imageSizePending;
522 $scope.setUpdatesPending(false);
523 $scope.queryParameters.save();
530 $scope.resultsUpdatedCallback = function() {
531 $scope.renderEndTime = window.performance.now();
532 $log.debug("renderEndTime: " + $scope.renderEndTime);
543 $scope.sortResultsBy = function(subdict, key) {
544 $scope.sortColumnSubdict = subdict;
545 $scope.sortColumnKey = key;
546 $scope.updateResults();
551 * sorting on (according to $scope.sortColumnSubdict and
552 * $scope.sortColumnKey).
556 $scope.getSortColumnValue = function(imagePair) {
557 if ($scope.sortColumnSubdict in imagePair) {
558 return imagePair[$scope.sortColumnSubdict][$scope.sortColumnKey];
559 } else if ($scope.sortColumnKey in imagePair) {
560 return imagePair[$scope.sortColumnKey];
576 $scope.getSecondOrderSortValue = function(imagePair) {
582 * Set $scope.categoryValueMatch[name] = value, and update results.
587 $scope.setCategoryValueMatch = function(name, value) {
588 $scope.categoryValueMatch[name] = value;
589 $scope.updateResults();
593 * Update $scope.hiddenResultTypes so that ONLY this resultType is showing,
598 $scope.showOnlyResultType = function(resultType) {
599 $scope.hiddenResultTypes = {};
600 // TODO(epoger): Maybe change $scope.allResultTypes to be a Set like
601 // $scope.hiddenResultTypes (rather than an array), so this operation is
603 $scope.toggleValuesInSet($scope.allResultTypes, $scope.hiddenResultTypes);
604 $scope.toggleValueInSet(resultType, $scope.hiddenResultTypes);
605 $scope.updateResults();
609 * Update $scope.hiddenResultTypes so that ALL resultTypes are showing,
612 $scope.showAllResultTypes = function() {
613 $scope.hiddenResultTypes = {};
614 $scope.updateResults();
618 * Update $scope.hiddenConfigs so that ONLY this config is showing,
623 $scope.showOnlyConfig = function(config) {
624 $scope.hiddenConfigs = {};
625 $scope.toggleValuesInSet($scope.allConfigs, $scope.hiddenConfigs);
626 $scope.toggleValueInSet(config, $scope.hiddenConfigs);
627 $scope.updateResults();
631 * Update $scope.hiddenConfigs so that ALL configs are showing,
634 $scope.showAllConfigs = function() {
635 $scope.hiddenConfigs = {};
636 $scope.updateResults();
652 * $scope.imagePairs (perhaps with some modifications)
654 $scope.submitApprovals = function(imagePairsSubset) {
655 $scope.submitPending = true;
659 var bugNumber = parseInt($scope.submitAdvancedSettings['bug']);
694 $scope.submitAdvancedSettings[
696 if (true == $scope.submitAdvancedSettings[
710 $scope.submitPending = false;
717 $scope.header[constants.KEY__HEADER__DATAHASH];
719 $scope.header[constants.KEY__HEADER__TYPE];
729 $scope.moveImagePairsToTab(imagePairIndicesToMove,
731 $scope.updateResults();
745 $scope.submitPending = false;
763 $scope.setSize = function(set) {
774 $scope.isValueInSet = function(value, set) {
784 $scope.toggleValueInSet = function(value, set) {
798 $scope.toggleValuesInSet = function(valueArray, set) {
801 $scope.toggleValueInSet(valueArray[i], set);
818 $scope.isValueInArray = function(value, array) {
829 $scope.toggleValueInArray = function(value, array) {
857 $scope.columnSliceOf2DArray = function(array, column) {
872 $scope.localTimeString = function(secondsPastEpoch) {
884 $scope.hexColorString = function(r, g, b) {
908 $scope.brightnessStringToHexColor = function(brightnessString) {
910 return $scope.hexColorString(v, v, v);
924 $scope.getImageDiffRelativeUrl = function(imagePair) {