Lines Matching defs:scope

16       scope: true,
17 link: function(scope, elm, attrs, ctrl) {
29 image.src = scope.record.differencePath;
33 image.src = scope.record.baselinePath;
37 image.src = scope.record.testPath;
54 scope.setImgScaleFactor(1 / divisor);
57 canvas.width = image.width * scope.imgScaleFactor;
58 canvas.height = image.height * scope.imgScaleFactor;
61 if (!scope.maskSizeUpdated) {
63 scope.updateMaskCanvasSize({width: canvas.width, height: canvas.height});
65 scope.maskCanvasSizeUpdated(true);
69 scope.renderImage();
74 scope.$watch('updatedMaskSize', function(updatedSize) {
85 scope.$watch('magnifyCenter', function(magCenter) {
90 scope.renderImage();
108 var imgRect = { x: (magCenter.x / scope.imgScaleFactor) - MAGNIFIER_HALF_WIDTH,
109 y: (magCenter.y / scope.imgScaleFactor) - MAGNIFIER_HALF_HEIGHT,
130 scope.renderImage = function() {
137 scope.computeMagnifierOutline = function(event) {
138 var scaledWidth = MAGNIFIER_WIDTH * scope.imgScaleFactor;
139 var scaledHeight = MAGNIFIER_HEIGHT * scope.imgScaleFactor;
150 scope.MagnifyDraw = function(event, startMagnify) {
152 scope.setMagnifierState(true);
153 } else if (!scope.magnifierOn) {
157 scope.renderImage();
160 var rect = scope.computeMagnifierOutline(event);
169 // update scope on baseline / test that will cause them to render
170 scope.setMagnifyCenter({x: event.offsetX, y: event.offsetY});
175 scope.MagnifyEnd = function(event) {
176 scope.renderImage();
177 // update scope on baseline / test that will cause them to render
178 scope.setMagnifierState(false);
179 scope.setMagnifyCenter(undefined);
185 function ImageController($scope, $http, $location, $timeout, $parse) {
186 $scope.imgScaleFactor = 1.0;
187 $scope.magnifierOn = false;
188 $scope.magnifyCenter = undefined;
189 $scope.updatedMaskSize = undefined;
190 $scope.maskSizeUpdated = false;
192 $scope.setImgScaleFactor = function(scaleFactor) {
193 $scope.imgScaleFactor = scaleFactor;
196 $scope.setMagnifierState = function(magnifierOn) {
197 $scope.magnifierOn = magnifierOn;
200 $scope.setMagnifyCenter = function(magnifyCenter) {
201 $scope.magnifyCenter = magnifyCenter;
204 $scope.updateMaskCanvasSize = function(updatedSize) {
205 $scope.updatedMaskSize = updatedSize;
208 $scope.maskCanvasSizeUpdated = function(flag) {
209 $scope.maskSizeUpdated = flag;
213 function DiffListController($scope, $http, $location, $timeout, $parse) {
216 $scope.isDynamic = ($location.protocol() == "http" || $location.protocol() == "https");
219 $scope.differs = [
228 // Puts the records within AngularJS scope
229 $scope.records = SkPDiffRecords.records;
233 $scope.lastSelectedIndex = undefined;
236 $scope.sortIndex = 1;
239 $scope.setSortIndex = function(idx) {
240 $scope.sortIndex = idx;
244 $scope.lastSelectedIndex = undefined;
248 $scope.sortingDiffer = function(record) {
249 return record.diffs[$scope.sortIndex].result;
254 $scope.flashStatus = function(success) {
260 $scope.statusClass = flashStyle;
264 $scope.statusClass = "";
268 $scope.selectedRebaseline = function(index, event) {
270 var recordsInOrder = $parse("records | orderBy:sortingDiffer")($scope);
274 if (event.shiftKey && $scope.lastSelectedIndex !== undefined) {
276 var smallerIndex = Math.min($scope.lastSelectedIndex, index);
277 var largerIndex = Math.max($scope.lastSelectedIndex, index);
281 $scope.lastSelectedIndex = index;
285 $scope.lastSelectedIndex = index;
290 $scope.commitRebaselines = function() {
293 for (var recordIndex = 0; recordIndex < $scope.records.length; recordIndex++) {
294 if ($scope.records[recordIndex].isRebaselined) {
295 rebaselines.push($scope.records[recordIndex].testPath);
301 $scope.flashStatus(data.success);
303 $scope.flashStatus(false);