# HG changeset patch # User rougeronj # Date 1427295465 -3600 # Node ID 4b3bebe4355d02175b28b0295a9b9cd498d2e236 # Parent b714bcbe915c545d509cb1ba81f2e98373f94749 add sanitize function to accept url from the request response - enable edit on dbclick - improve html diff -r b714bcbe915c -r 4b3bebe4355d client/app/app.js --- a/client/app/app.js Wed Mar 25 15:55:38 2015 +0100 +++ b/client/app/app.js Wed Mar 25 15:57:45 2015 +0100 @@ -20,11 +20,7 @@ controller: 'slidesCtrl', templateUrl: 'slides/slides.html' }). - when('/slide/edit/:idSlide', { - controller: 'slideEditCtrl', - templateUrl: 'slides/slides.html' - }). - when('/slideshow', { + when('/slideshow/', { controller: 'slideshowCtrl', templateUrl: 'slideshow/slideshow.html' }). @@ -49,8 +45,8 @@ templateUrl: 'search/search.html' }). when('/login', { - controller: 'loginCtrl', - templateUrl: 'login/login.html' + controller: 'authCtrl', + templateUrl: 'auth/auth.html' }). otherwise({ redirectTo: '/' @@ -65,7 +61,7 @@ .config(function($logProvider){ $logProvider.debugEnabled(true); }) - .service('searchApi', function($resource, context) { + .service('searchApi', function($resource, context, $sce) { this.searchResource = function(params){ return $resource(context.urls.searchUrl, { @@ -101,6 +97,15 @@ this.booksSlides = $resource(context.urls.ammicoUrl+'/books/:idBook/slides/', {idBook:'@idBook'}); this.listSlides= $resource(context.urls.ammicoUrl+'/slides/'); this.slide = $resource(context.urls.ammicoUrl+'/slides/:idSlide/', {idSlide:'@idSlide'}); + this.sanitizeUrls = function(data){ + console.log('heyr there !'); + console.log(data); + data.details.audio = $sce.trustAsResourceUrl(data.details.audio); + data.details.video = $sce.trustAsResourceUrl(data.details.video); + data.audio = $sce.trustAsResourceUrl(data.audio); + data.video = $sce.trustAsResourceUrl(data.video); + return data; + }; }); })(); diff -r b714bcbe915c -r 4b3bebe4355d client/app/slides/dataEditor.html --- a/client/app/slides/dataEditor.html Wed Mar 25 15:55:38 2015 +0100 +++ b/client/app/slides/dataEditor.html Wed Mar 25 15:57:45 2015 +0100 @@ -1,14 +1,17 @@ -
-
-

{{slide.user_title}}

-

{{slide.user_description}}

-

{{slide.tags.join(', ')}}

-

-
-
- - - -

-
+
+
+

{{slide.title}}

+

{{slide.description}}

+

{{slide.comments}}

+

{{slide.tags.join(', ')}}

+
+
+ +
+ + + + +
+
\ No newline at end of file diff -r b714bcbe915c -r 4b3bebe4355d client/app/slides/slides.css --- a/client/app/slides/slides.css Wed Mar 25 15:55:38 2015 +0100 +++ b/client/app/slides/slides.css Wed Mar 25 15:57:45 2015 +0100 @@ -1,9 +1,32 @@ -.media { - border: 1px solid; +.slide { + margin-top: -20px; +} + +.slide-title, +.slide-nav, +.slide-content { + border-bottom:1px solid grey; } -.media img{ - max-height: 500px; +.slide-nav{ + padding:10px 0; + display: inline-block; + width: 100%; +} + +.slide-content{ + padding:10px 0; + height: 524px; +} + +.media{ + border-right:1px solid grey; + height: 100% +} + +.media img, +.media video{ + max-height: 100%; max-width: 100%; display: block; margin: auto; @@ -14,17 +37,40 @@ position: static; text-shadow: none; text-align: left; - border: 1px solid; + overflow: scroll; + height: 100% } .original-text { font-style: italic; } -textarea.form-control { +.user-details textarea.form-control { height: 140px; + margin: 10px 0; +} +.user-details input.form-control{ + margin: 10px 0; +} + +#back{ + float:left; + margin: 0 10px; } -.ng-binding img{ - height: 80px; +#previous, +#next{ + float:right; + margin: 0 10px; +} +.user-details p, +.user-details h4{ + border: 1px solid #ededed; + min-height: 21px; + padding: 6px 12px; + border-radius: 4px; +} + +.user-details p.description{ + min-height: 140px; } \ No newline at end of file diff -r b714bcbe915c -r 4b3bebe4355d client/app/slides/slides.html --- a/client/app/slides/slides.html Wed Mar 25 15:55:38 2015 +0100 +++ b/client/app/slides/slides.html Wed Mar 25 15:57:45 2015 +0100 @@ -1,20 +1,29 @@ -

Slide

-
-
- +
+
+

{{slide.title}} - {{slide.details.title}}

+
+ -
- -
-

{{ slide.metas_dict.name }}

-

{{ slide.metas_dict.description }}

-

- Titre : {{ - slide.details.title }} -

-

- Description :  -

+
+
+ + + +
+
+ +
+
+

+ Titre : {{slide.details.title}} +

+

+ Description : {{slide.details.captionImg}} +

+
+
diff -r b714bcbe915c -r 4b3bebe4355d client/app/slides/slides_controller.js --- a/client/app/slides/slides_controller.js Wed Mar 25 15:55:38 2015 +0100 +++ b/client/app/slides/slides_controller.js Wed Mar 25 15:57:45 2015 +0100 @@ -2,10 +2,11 @@ 'use strict'; angular.module('ammicoSlides',['ngResource', 'ngRoute']) - .controller('slidesCtrl', function($scope, $routeParams, searchApi, $sce){ - + .controller('slidesCtrl', function($scope, $routeParams, searchApi){ + console.log($scope.currentBook); + $scope.slide = searchApi.slide.get({idSlide:$routeParams.idSlide, format:'json'}, function(data){ - data.details.description = $sce.trustAsHtml(data.details.description); + data = searchApi.sanitizeUrls(data); }); $scope.save = function(){ @@ -23,13 +24,16 @@ $scope.slidesave = function(){ if(typeof $scope.slide.tags === 'string'){ $scope.slide.tags = $scope.slide.tags.split(','); - } - for (var i = $scope.slide.tags.length - 1; i >= 0; i--) { - $scope.slide.tags[i] = $scope.slide.tags[i].trim(); + for (var i = $scope.slide.tags.length - 1; i >= 0; i--) { + $scope.slide.tags[i] = $scope.slide.tags[i].trim(); + } } $scope.slide.editMode = false; $scope.save(); }; + $scope.doubleClick = function(){ + $scope.slide.editMode = true; + }; } }; });