Add screenshots to UI. Still need to implement resizing.

This commit is contained in:
Simo Kinnunen
2014-05-20 11:34:39 +09:00
parent 48726669dc
commit 254b2dc7a3
5 changed files with 49 additions and 19 deletions

View File

@@ -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)
})
})
}
}