mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-27 03:05:13 +02:00
Add screenshots to UI. Still need to implement resizing.
This commit is contained in:
@@ -1,3 +1,31 @@
|
||||
module.exports = function ScreenshotsCtrl($scope) {
|
||||
|
||||
module.exports = function ScreenshotsCtrl($scope, SettingsService) {
|
||||
$scope.screenshots = []
|
||||
$scope.shotSize = 'original'
|
||||
|
||||
$scope.clear = function () {
|
||||
$scope.screenshots = []
|
||||
}
|
||||
|
||||
SettingsService.bind($scope, {
|
||||
key: 'shotSize'
|
||||
, storeName: 'ScreenShots.shotSize'
|
||||
})
|
||||
|
||||
$scope.shotSizeUrlParameter = function () {
|
||||
var sizes = {
|
||||
'small': '?crop=100x',
|
||||
'medium': '?crop=320x',
|
||||
'large': '?crop=450x',
|
||||
'original': ''
|
||||
}
|
||||
return sizes[$scope.shotSize]
|
||||
}
|
||||
|
||||
$scope.takeScreenShot = function () {
|
||||
$scope.control.screenshot().then(function(result) {
|
||||
$scope.$apply(function() {
|
||||
$scope.screenshots.push(result)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user