From adc2f8b0d9eeac570dbb5c05f79e3ff862ff9f23 Mon Sep 17 00:00:00 2001 From: Smoky Desperado Date: Fri, 8 Jun 2018 15:05:12 +0200 Subject: [PATCH] aws prototyped --- .jshintrc | 3 ++- app/index.html | 4 +++- app/scripts/controllers/mvContent.js | 10 ++++----- app/scripts/directives/mvContent.js | 4 +++- app/scripts/models/content.js | 11 +++++++++- app/scripts/services/aws.js | 32 ++++++++++++++++++++++++++++ app/scripts/services/content.js | 5 +++++ app/scripts/services/dragAndDrop.js | 8 +++---- bower.json | 3 ++- test/karma.conf.js | 1 + 10 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 app/scripts/services/aws.js diff --git a/.jshintrc b/.jshintrc index 4572e5d..b603d41 100644 --- a/.jshintrc +++ b/.jshintrc @@ -11,6 +11,7 @@ "undef": true, "unused": true, "globals": { - "angular": false + "angular": false, + "AWS" : false } } diff --git a/app/index.html b/app/index.html index 0a5c346..aff4d45 100644 --- a/app/index.html +++ b/app/index.html @@ -8,7 +8,7 @@ - + @@ -56,6 +56,7 @@ + @@ -86,6 +87,7 @@ + diff --git a/app/scripts/controllers/mvContent.js b/app/scripts/controllers/mvContent.js index 39c18ff..21ebe2e 100644 --- a/app/scripts/controllers/mvContent.js +++ b/app/scripts/controllers/mvContent.js @@ -23,7 +23,7 @@ angular.module('moveditorApp') this.init = function () { this.contentObjects = ContentService.getContentList(); this.initDummyObject(); - console.log('content list initialized:', this.contentObjects, this.dummyObjects); + // console.log('content list initialized:', this.contentObjects, this.dummyObjects); }; this.addContentMaterial = function () { @@ -32,11 +32,11 @@ angular.module('moveditorApp') ContentService.addContentObjectToList(this.dummyObjects[this.dummyIndex]); this.dummyIndex++; - console.log('object added'); - } - else { - console.warn('all dummy objects added'); + // console.log('object added'); } + // else { + // console.warn('all dummy objects added'); + // } }; this.loadContentMaterial = function () { diff --git a/app/scripts/directives/mvContent.js b/app/scripts/directives/mvContent.js index 3d28e2d..ba4ccd2 100644 --- a/app/scripts/directives/mvContent.js +++ b/app/scripts/directives/mvContent.js @@ -7,7 +7,9 @@ * # navigator */ angular.module('moveditorApp') - .directive('mvContent', [function () { + .directive('mvContent', [ + 'AWSService', + function (AWSService) { return { templateUrl: '/views/directives/mv_content.html', replace: true, diff --git a/app/scripts/models/content.js b/app/scripts/models/content.js index 916b3ec..345193c 100644 --- a/app/scripts/models/content.js +++ b/app/scripts/models/content.js @@ -17,6 +17,7 @@ angular.module('moveditorApp') this.length = length; this.url = url; this.active = 0; + this.mpd = ''; } // ========================================================================================================= @@ -39,10 +40,14 @@ angular.module('moveditorApp') return this.url; }; - Content.prototype.getActive = function (active) { + Content.prototype.getActive = function () { return this.active; }; + Content.prototype.getMpd = function () { + return this.mpd; + }; + // ========================================================================================================= // setter // ========================================================================================================= @@ -67,6 +72,10 @@ angular.module('moveditorApp') this.active = active; }; + Content.prototype.setMdp = function (mdp) { + this.mdp = mdp; + }; + // ========================================================================================================= // functions // ========================================================================================================= diff --git a/app/scripts/services/aws.js b/app/scripts/services/aws.js new file mode 100644 index 0000000..01caf5f --- /dev/null +++ b/app/scripts/services/aws.js @@ -0,0 +1,32 @@ +'use strict'; + +/** + * @ngdoc service + * @name moveditorApp.mvNav + * @description + * # mvNav + * Service in the moveditorApp. + */ +angular.module('moveditorApp') + .service('AWSService', [ + 'MvHelperService', + 'ContentService', + function (MvHelperService, ContentService) { + var self = this; + + this.aws = null; + + this.init = function () { + this.aws = new AWS.SQS(); + console.log('init:', this.aws); + }; + + this.requestSegmentation = function (contetnMaterialIndex, url) { + // ToDo: do stuff + + var mpd = ''; // ToDo: set mpd url + ContentService.addMpdForContentObject(contetnMaterialIndex, mpd); + }; + + this.init(); + }]); diff --git a/app/scripts/services/content.js b/app/scripts/services/content.js index b80f445..7c72040 100644 --- a/app/scripts/services/content.js +++ b/app/scripts/services/content.js @@ -43,4 +43,9 @@ angular.module('moveditorApp') this.getContentUrlList = function () { return this.contentUrlList; }; + + // ToDo: check functionality and correctness + this.addMpdForContentObject = function (contetnMaterialIndex, mpd) { + this.contentList[contetnMaterialIndex].setMdp(mpd); + }; }]); diff --git a/app/scripts/services/dragAndDrop.js b/app/scripts/services/dragAndDrop.js index 0b4a514..b78ae78 100644 --- a/app/scripts/services/dragAndDrop.js +++ b/app/scripts/services/dragAndDrop.js @@ -18,7 +18,7 @@ angular.module('moveditorApp') this.dropableElement = null; this.init = function () { - console.log('drag and drop service'); + // console.log('drag and drop service'); }; this.panMoveStarted = function (id) { @@ -26,7 +26,7 @@ angular.module('moveditorApp') }; this.panMove = function () { - console.log('pan move'); + // console.log('pan move'); }; this.panMoveEnd = function ($event, contentObjectKey) { @@ -35,7 +35,7 @@ angular.module('moveditorApp') TimelineService.addTimelineObjectToList(contentObjectKey); } - console.log('timelineList:', TimelineService.timelineList); + // console.log('timelineList:', TimelineService.timelineList); }; this.setDropableElement = function (elemment) { @@ -53,7 +53,7 @@ angular.module('moveditorApp') timelineAttributes.height = elemment[0].offsetHeight; this.dropableElement = timelineAttributes; - console.log(this.dropableElement); + // console.log(this.dropableElement); }; this.hitTest = function (draggableElement) { diff --git a/bower.json b/bower.json index d3ed8db..46c436a 100644 --- a/bower.json +++ b/bower.json @@ -12,7 +12,8 @@ "angular-route": "^1.4.0", "angular-sanitize": "^1.4.0", "angular-touch": "^1.4.0", - "AngularHammer": "ryanmullins-angular-hammer#^2.2.0" + "AngularHammer": "ryanmullins-angular-hammer#^2.2.0", + "aws-sdk": "aws-sdk-js#^2.253.1" }, "devDependencies": { "angular-mocks": "^1.4.0" diff --git a/test/karma.conf.js b/test/karma.conf.js index eb141b5..e23f024 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -33,6 +33,7 @@ module.exports = function (config) { 'bower_components/angular-touch/angular-touch.js', 'bower_components/hammerjs/hammer.js', 'bower_components/AngularHammer/angular.hammer.js', + 'bower_components/aws-sdk/dist/aws-sdk.js', 'bower_components/angular-mocks/angular-mocks.js', // endbower 'app/scripts/**/*.js',