ode-ngjs-front 1.4.11-develop-integration.202506041736 → 1.4.12-dev.202507031207

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/669.js +1 -1
  2. package/dist/669.js.map +1 -1
  3. package/dist/ode-ngjs-front.js +4 -4
  4. package/dist/ode-ngjs-front.js.map +1 -1
  5. package/dist/ts/directives/business/portal/portal.directive.d.ts.map +1 -1
  6. package/dist/ts/modules/widgets.module.d.ts +1 -3
  7. package/dist/ts/modules/widgets.module.d.ts.map +1 -1
  8. package/dist/ts/services/theme-helper.service.d.ts.map +1 -1
  9. package/dist/version.txt +1 -1
  10. package/dist/widgets/agenda-widget/agenda-widget.widget.js +1 -1
  11. package/dist/widgets/agenda-widget/agenda-widget.widget.js.map +1 -1
  12. package/dist/widgets/bookmark-widget/bookmark-widget.widget.js +1 -1
  13. package/dist/widgets/bookmark-widget/bookmark-widget.widget.js.map +1 -1
  14. package/dist/widgets/briefme-widget/briefme-widget.widget.js +1 -1
  15. package/dist/widgets/briefme-widget/briefme-widget.widget.js.map +1 -1
  16. package/dist/widgets/calendar-widget/calendar-widget.widget.js +1 -1
  17. package/dist/widgets/calendar-widget/calendar-widget.widget.js.map +1 -1
  18. package/dist/widgets/cantine-widget/cantine-widget.widget.js +1 -1
  19. package/dist/widgets/cantine-widget/cantine-widget.widget.js.map +1 -1
  20. package/dist/widgets/carnet-de-bord/carnet-de-bord.widget.js +1 -1
  21. package/dist/widgets/carnet-de-bord/carnet-de-bord.widget.js.map +1 -1
  22. package/dist/widgets/cursus-widget/cursus-widget.widget.js +1 -1
  23. package/dist/widgets/cursus-widget/cursus-widget.widget.js.map +1 -1
  24. package/dist/widgets/dicodelazone-widget/dicodelazone-widget.widget.js +1 -1
  25. package/dist/widgets/dicodelazone-widget/dicodelazone-widget.widget.js.map +1 -1
  26. package/dist/widgets/edumalin-widget/edumalin-widget.widget.js +1 -1
  27. package/dist/widgets/edumalin-widget/edumalin-widget.widget.js.map +1 -1
  28. package/dist/widgets/last-infos-widget/last-infos-widget.widget.js +1 -1
  29. package/dist/widgets/last-infos-widget/last-infos-widget.widget.js.map +1 -1
  30. package/dist/widgets/maxicours-widget/maxicours-widget.widget.js +1 -1
  31. package/dist/widgets/maxicours-widget/maxicours-widget.widget.js.map +1 -1
  32. package/dist/widgets/mediacentre-widget/mediacentre-widget.widget.js +1 -1
  33. package/dist/widgets/mediacentre-widget/mediacentre-widget.widget.js.map +1 -1
  34. package/dist/widgets/my-apps/my-apps.widget.js +1 -1
  35. package/dist/widgets/my-apps/my-apps.widget.js.map +1 -1
  36. package/dist/widgets/qwant-widget/qwant-widget.widget.js +1 -1
  37. package/dist/widgets/qwant-widget/qwant-widget.widget.js.map +1 -1
  38. package/dist/widgets/record-me/record-me.widget.js +1 -1
  39. package/dist/widgets/record-me/record-me.widget.js.map +1 -1
  40. package/dist/widgets/rss-widget/rss-widget.widget.js +1 -1
  41. package/dist/widgets/rss-widget/rss-widget.widget.js.map +1 -1
  42. package/dist/widgets/school-widget/school-widget.widget.js +1 -1
  43. package/dist/widgets/school-widget/school-widget.widget.js.map +1 -1
  44. package/dist/widgets/universalis-widget/universalis-widget.widget.js +1 -1
  45. package/dist/widgets/universalis-widget/universalis-widget.widget.js.map +1 -1
  46. package/package.json +2 -3
  47. package/dist/668.js +0 -21
  48. package/dist/668.js.map +0 -1
  49. package/dist/ts/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.d.ts +0 -2
  50. package/dist/ts/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.d.ts.map +0 -1
  51. package/dist/ts/widgets/screen-time-widget/screen-time-widget.widget.d.ts +0 -19
  52. package/dist/ts/widgets/screen-time-widget/screen-time-widget.widget.d.ts.map +0 -1
  53. package/dist/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.js +0 -2
  54. package/dist/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.js.map +0 -1
  55. package/dist/widgets/screen-time-widget/screen-time-widget.widget.js +0 -2
  56. package/dist/widgets/screen-time-widget/screen-time-widget.widget.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[447],{1891:(t,e,n)=>{n.d(e,{Z:()=>i});const i=' <style>.widget-dashboard .dashboard-list .item:nth-child(2n){background:#fafafa}</style> <div class="widget-dashboard"> <div class="widget-header" style="border:0"> <div class="subtitle"> <a class="seemore" href="#" ng-click="ctrl.onButtonClick(ctrl.generateLinkGar(), \'EDUMALIN_OPEN_GAR\')" style="display:flex"> <img src="/assets/widgets/edumalin-widget/edumalin.png" width="40" height="40" alt="edumalin"/> <span style="padding-left:20px"><i18n>edumalin.title</i18n></span> </a> </div> <div class="widget-options"> <div class="widget-handle" title="Déplacer le widget"> <i class="fas fa-grip-vertical" aria-hidden="true"></i> </div> </div> </div> <div class="widget-body" dnd-nodrag> <div ng-if="!ctrl.isDataLoaded" class="widget-empty-message"> <div class="row row-cols-1 align-items-center"> <div class="mb-3"> <div class="widget-empty-message" ng-if="ctrl.userEvents === undefined || ctrl.userEvents.length === 0"> <i18n>edumalin.empty</i18n> </div> </div> </div> </div> <ul class="dashboard-list" ng-if="ctrl.isDataLoaded"> <li class="item link-discret" ng-repeat="widget in ctrl.data" ng-click="ctrl.openLightBox(widget, $event)"> <a href="#" class="item-inner"> <div class="row"> <div class="col-3 mt-16"> <img ng-if="!ctrl.isURL(widget.picture)" src="/assets/widgets/edumalin-widget/edumalin.png" width="40" height="40" alt="edumalin" class="m-auto"/> <img ng-if="ctrl.isURL(widget.picture)" ng-src="{{ctrl.encodeUrlPicture(widget.picture)}}" width="60" height="60" alt="edumalin" class="m-auto"/> </div> <div class="col-9"> <div class="subtitle" translate content="[[widget.title]]"></div> <div class="subtext" translate ng-if="widget.description" content="[[widget.description.length>70 ? widget.description.slice(0, 70) + \' ...\' : widget.description]]"></div> <div class="info meta" ng-style="{\'color\': ctrl.displayIconColor(widget.type.name)}" ng-if="widget.type"> <i class="fas [[ctrl.displayIcon(widget.type.name)]]"></i> [[widget.type.name]] </div> </div> </div> </a> </li> </ul> </div> <ode-modal visible="ctrl.showLightbox" on-close="ctrl.showLightbox=false" size="lg" class="modal-widget"> <ode-modal-title> <h2 translate content="[[ctrl.currentWidget.title]]"></h2> </ode-modal-title> <ode-modal-body> <div class="container"> <div class="row"> <div class="col-md-4 col-sm-12"> <img ng-if="!ctrl.isURL(ctrl.currentWidget.picture)" src="/assets/widgets/edumalin-widget/edumalin.png" width="200" height="200" alt="edumalin" class="m-auto"/> <img ng-if="ctrl.isURL(ctrl.currentWidget.picture)" ng-src="{{ctrl.encodeUrlPicture(ctrl.currentWidget.picture)}}" width="200" height="200" alt="edumalin" class="m-auto"/> </div> <div class="col-md-8 col-sm-12"> <div class="label" translate content="[[ctrl.currentWidget.description]]"></div> <div class="mb-3 mt-12" ng-if="ctrl.isTypeRDV(ctrl.currentWidget.type.name)" ng-style="{\'color\': ctrl.displayIconColor(ctrl.currentWidget.type.name)}"> <a href="[[ctrl.currentWidget.googleMap]]" target="_blank" rel="noopener"> <div class="label"> <i class="fas [[ctrl.displayIcon(ctrl.currentWidget.type.name)]]"></i> <span translate content="[[ctrl.currentWidget.type.name]]"></span> </div> </a> </div> <div class="mb-3 mt-12" ng-if="!ctrl.isTypeRDV(ctrl.currentWidget.type.name)"> <div class="label"> <i class="fas [[ctrl.displayIcon(ctrl.currentWidget.type.name)]]" ng-style="{\'color\': ctrl.displayIconColor(ctrl.currentWidget.type.name)}"></i> <span translate content="[[ctrl.currentWidget.type.name]]" ng-style="{\'color\': ctrl.displayIconColor(ctrl.currentWidget.type.name)}"></span> <span ng-if="ctrl.isTypeWebinaire(ctrl.currentWidget.type.name)"> | <i18n>edumalin.webinaire.date</i18n>: [[ctrl.dateFormat(ctrl.currentWidget.dateTime)]] | <i18n>edumalin.webinaire.duration</i18n>: [[ctrl.currentWidget.duration]] min</span> </div> </div> </div> </div> </div> <div class="d-flex justify-content-end"> <button type="button" class="btn btn-outline-primary ng-binding ng-scope" ng-click="ctrl.onButtonClick(ctrl.generateLinkGar(), \'EDUMALIN_OPEN_GAR\')" style="margin-right:1%" translate content="edumalin.acceder"/> <button ng-if="ctrl.currentWidget.buttonLink" type="button" class="btn btn-primary ng-binding ng-scope" ng-click="ctrl.onButtonClick(ctrl.currentWidget.buttonLink, \'EDUMALIN_OPEN_LINK\')" translate> {{ctrl.currentWidget.buttonTitle}} </button> </div> </ode-modal-body> </ode-modal> </div> '},3691:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function l(t){try{c(i.next(t))}catch(t){a(t)}}function s(t){try{c(i.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(l,s)}c((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,a,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,i=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(r=l.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){l=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){l.label=a[1];break}if(6===a[0]&&l.label<r[1]){l.label=r[1],r=a;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(a);break}r[2]&&l.ops.pop(),l.trys.pop();continue}a=e.call(t,l)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.odeModuleName=void 0;var l=a(n(4202)),s=n(9419),c=a(n(381)),o=function(){function t(){this.data={},this.error=null,this.showLightbox=!1,this.urlGar="https://idp-auth.gar.education.fr/domaineGar?idENT=ID_ENT&idEtab=ID_ETAB&idRessource=ark:/19496/UVdpWxn8N78r24"}return t.prototype.onButtonClick=function(t,e){e&&e.length>0&&this.trackEvent(e),window.open(t,"_blank")},Object.defineProperty(t.prototype,"isDataLoaded",{get:function(){return this.data.length>0},enumerable:!1,configurable:!0}),t.prototype.dateFormat=function(t){return(0,c.default)(t).format("L")},t.prototype.isTypeRDV=function(t){return"RDV"==t},t.prototype.isTypeWebinaire=function(t){return"Webinaire"==t},t.prototype.displayIcon=function(t){switch(t){case"RDV":return"fa-calendar-alt";case"Webinaire":return"fa-video";case"Annonce":return"fa-bullhorn";case"Actualité":return"fa-newspaper";case"Temoignage":return"fa-microphone-lines";case"Podcast":return"fa-headset";case"Replay":return"fa-rotate-left";case"Tutoriel":return"fa-wand-magic-sparkles";default:return"fa-info"}},t.prototype.displayIconColor=function(t){switch(t){case"RDV":return"#2a9cc8";case"Webinaire":return"#20c997";case"Annonce":return"#E13A3A";case"Actualité":return"#FF8D2E";case"Temoignage":return"#2029B6";case"Podcast":return"#823AA1";case"Replay":return"#46BFAF";case"Tutoriel":return"#ecbe30";default:return"#f59700"}},t.prototype.openLightBox=function(t,e){this.currentWidget=t,this.showLightbox=!0,e.currentTarget&&this.trackEvent("EDUMALIN_OPEN_MODAL")},t.prototype.isURL=function(t){return!!(t&&t.length>0&&(t.startsWith("http://")||t.startsWith("https://")))},t.prototype.generateLinkGar=function(){if((0,s.session)().description&&(0,s.session)().description.schools&&(0,s.session)().description.schools.length>0){var t=(0,s.session)().description.schools[0],e=s.Base64.encode(null!=(null==t?void 0:t.UAI)?t.UAI:""),n=null!=t.exports?t.exports:[],i="";if(null!=n){for(var r=0;r<n.length;++r)if(n[r].startsWith("GAR-")){i=n[r].replace("GAR-","");break}""==i&&(i=n[0])}var a=s.Base64.encode(i);return this.urlGar.replace("ID_ETAB",e).replace("ID_ENT",a)}return"https://edumalin.fr/"},t.prototype.trackEvent=function(t){if(t&&t.length>0){var e={"event-type":t,modal:"Timeline"};(0,s.http)().post("/infra/event/web/store",e).catch((function(t){console.debug("[TrackingInternal] failed to trackEvent: ",t)}))}},t.prototype.encodeUrlPicture=function(t){return encodeURI(t)},t}(),d=function(){function t(){this.restrict="E",this.template=n(1891).Z,this.scope={},this.bindToController=!0,this.controller=[o],this.controllerAs="ctrl",this.require=["odeEdumalinWidget"]}return t.prototype.link=function(t,e,n,a){return i(this,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return(e=a?a[0]:null)?[4,(0,s.http)().get("/appregistry/edumalin/widget").then((function(n){n.success?(e.data=n.data,t.$apply()):e.error=n.error}))]:[2];case 1:return n.sent(),[2]}}))}))},t}();(0,s.notif)().onLangReady().promise.then((function(t){(0,s.conf)().Platform.idiom.addKeys(n(7918))})),e.odeModuleName="odeEdumalinWidgetModule",l.default.module(e.odeModuleName,[]).directive("odeEdumalinWidget",(function(){return new d}))},7918:t=>{t.exports=JSON.parse('{"edumalin.title":"Édumalin","edumalin.acceder":"Accéder à Édumalin","edumalin.empty":"Aucun résultat","edumalin.webinaire.date":"Date","edumalin.webinaire.duration":"Duration"}')}}]);
1
+ "use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[447],{1891:(t,e,n)=>{n.d(e,{Z:()=>i});const i=' <style>.widget-dashboard .dashboard-list .item:nth-child(2n){background:#fafafa}</style> <div class="widget-dashboard"> <div class="widget-header" style="border:0"> <div class="subtitle"> <a class="seemore" href="#" ng-click="ctrl.onButtonClick(ctrl.generateLinkGar(), \'EDUMALIN_OPEN_GAR\')" style="display:flex"> <img src="/assets/widgets/edumalin-widget/edumalin.png" width="40" height="40" alt="edumalin"/> <span style="padding-left:20px"><i18n>edumalin.title</i18n></span> </a> </div> <div class="widget-options"> <div class="widget-handle" title="Déplacer le widget"> <i class="fas fa-grip-vertical" aria-hidden="true"></i> </div> </div> </div> <div class="widget-body" dnd-nodrag> <div ng-if="!ctrl.isDataLoaded" class="widget-empty-message"> <div class="row row-cols-1 align-items-center"> <div class="mb-3"> <div class="widget-empty-message" ng-if="ctrl.userEvents === undefined || ctrl.userEvents.length === 0"> <i18n>edumalin.empty</i18n> </div> </div> </div> </div> <ul class="dashboard-list" ng-if="ctrl.isDataLoaded"> <li class="item link-discret" ng-repeat="widget in ctrl.data" ng-click="ctrl.openLightBox(widget, $event)"> <a href="#" class="item-inner"> <div class="row"> <div class="col-3 mt-16"> <img ng-if="!ctrl.isURL(widget.picture)" src="/assets/widgets/edumalin-widget/edumalin.png" width="40" height="40" alt="edumalin" class="m-auto"/> <img ng-if="ctrl.isURL(widget.picture)" ng-src="{{ctrl.encodeUrlPicture(widget.picture)}}" width="60" height="60" alt="edumalin" class="m-auto"/> </div> <div class="col-9"> <div class="subtitle" translate content="[[widget.title]]"></div> <div class="subtext" translate ng-if="widget.description" content="[[widget.description.length>70 ? widget.description.slice(0, 70) + \' ...\' : widget.description]]"></div> <div class="info meta" ng-style="{\'color\': ctrl.displayIconColor(widget.type.name)}" ng-if="widget.type"> <i class="fas [[ctrl.displayIcon(widget.type.name)]]"></i> [[widget.type.name]] </div> </div> </div> </a> </li> </ul> </div> <ode-modal visible="ctrl.showLightbox" on-close="ctrl.showLightbox=false" size="lg" class="modal-widget"> <ode-modal-title> <h2 translate content="[[ctrl.currentWidget.title]]"></h2> </ode-modal-title> <ode-modal-body> <div class="container"> <div class="row"> <div class="col-md-4 col-sm-12"> <img ng-if="!ctrl.isURL(ctrl.currentWidget.picture)" src="/assets/widgets/edumalin-widget/edumalin.png" width="200" height="200" alt="edumalin" class="m-auto"/> <img ng-if="ctrl.isURL(ctrl.currentWidget.picture)" ng-src="{{ctrl.encodeUrlPicture(ctrl.currentWidget.picture)}}" width="200" height="200" alt="edumalin" class="m-auto"/> </div> <div class="col-md-8 col-sm-12"> <div class="label" translate content="[[ctrl.currentWidget.description]]"></div> <div class="mb-3 mt-12" ng-if="ctrl.isTypeRDV(ctrl.currentWidget.type.name)" ng-style="{\'color\': ctrl.displayIconColor(ctrl.currentWidget.type.name)}"> <a href="[[ctrl.currentWidget.googleMap]]" target="_blank" rel="noopener"> <div class="label"> <i class="fas [[ctrl.displayIcon(ctrl.currentWidget.type.name)]]"></i> <span translate content="[[ctrl.currentWidget.type.name]]"></span> </div> </a> </div> <div class="mb-3 mt-12" ng-if="!ctrl.isTypeRDV(ctrl.currentWidget.type.name)"> <div class="label"> <i class="fas [[ctrl.displayIcon(ctrl.currentWidget.type.name)]]" ng-style="{\'color\': ctrl.displayIconColor(ctrl.currentWidget.type.name)}"></i> <span translate content="[[ctrl.currentWidget.type.name]]" ng-style="{\'color\': ctrl.displayIconColor(ctrl.currentWidget.type.name)}"></span> <span ng-if="ctrl.isTypeWebinaire(ctrl.currentWidget.type.name)"> | <i18n>edumalin.webinaire.date</i18n>: [[ctrl.dateFormat(ctrl.currentWidget.dateTime)]] | <i18n>edumalin.webinaire.duration</i18n>: [[ctrl.currentWidget.duration]] min</span> </div> </div> </div> </div> </div> <div class="d-flex justify-content-end"> <button type="button" class="btn btn-outline-primary ng-binding ng-scope" ng-click="ctrl.onButtonClick(ctrl.generateLinkGar(), \'EDUMALIN_OPEN_GAR\')" style="margin-right:1%" translate content="edumalin.acceder"/> <button ng-if="ctrl.currentWidget.buttonLink" type="button" class="btn btn-primary ng-binding ng-scope" ng-click="ctrl.onButtonClick(ctrl.currentWidget.buttonLink, \'EDUMALIN_OPEN_LINK\')" translate> {{ctrl.currentWidget.buttonTitle}} </button> </div> </ode-modal-body> </ode-modal> </div> '},3691:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,a){function l(t){try{c(i.next(t))}catch(t){a(t)}}function s(t){try{c(i.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(l,s)}c((i=i.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var n,i,r,a,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,i=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(r=l.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){l=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){l.label=a[1];break}if(6===a[0]&&l.label<r[1]){l.label=r[1],r=a;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(a);break}r[2]&&l.ops.pop(),l.trys.pop();continue}a=e.call(t,l)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.odeModuleName=void 0;var l=a(n(4202)),s=n(9419),c=a(n(381)),o=function(){function t(){this.data={},this.error=null,this.showLightbox=!1,this.urlGar="https://idp-auth.gar.education.fr/domaineGar?idENT=ID_ENT&idEtab=ID_ETAB&idRessource=ark:/19496/UVdpWxn8N78r24"}return t.prototype.onButtonClick=function(t,e){e&&e.length>0&&this.trackEvent(e),window.open(t,"_blank")},Object.defineProperty(t.prototype,"isDataLoaded",{get:function(){return this.data.length>0},enumerable:!1,configurable:!0}),t.prototype.dateFormat=function(t){return(0,c.default)(t).format("L")},t.prototype.isTypeRDV=function(t){return"RDV"==t},t.prototype.isTypeWebinaire=function(t){return"Webinaire"==t},t.prototype.displayIcon=function(t){switch(t){case"RDV":return"fa-calendar-alt";case"Webinaire":return"fa-video";case"Annonce":return"fa-bullhorn";case"Actualité":return"fa-newspaper";case"Temoignage":return"fa-microphone-lines";case"Podcast":return"fa-headset";case"Replay":return"fa-rotate-left";case"Tutoriel":return"fa-wand-magic-sparkles";default:return"fa-info"}},t.prototype.displayIconColor=function(t){switch(t){case"RDV":return"#2a9cc8";case"Webinaire":return"#20c997";case"Annonce":return"#E13A3A";case"Actualité":return"#FF8D2E";case"Temoignage":return"#2029B6";case"Podcast":return"#823AA1";case"Replay":return"#46BFAF";case"Tutoriel":return"#ecbe30";default:return"#f59700"}},t.prototype.openLightBox=function(t,e){this.currentWidget=t,this.showLightbox=!0,e.currentTarget&&this.trackEvent("EDUMALIN_OPEN_MODAL")},t.prototype.isURL=function(t){return!!(t&&t.length>0&&(t.startsWith("http://")||t.startsWith("https://")))},t.prototype.generateLinkGar=function(){if((0,s.session)().description&&(0,s.session)().description.schools&&(0,s.session)().description.schools.length>0){var t=(0,s.session)().description.schools[0],e=s.Base64.encode(null!=(null==t?void 0:t.UAI)?t.UAI:""),n=null!=t.exports?t.exports:[],i="";if(null!=n){for(var r=0;r<n.length;++r)if(n[r].startsWith("GAR-")){i=n[r].replace("GAR-","");break}""==i&&(i=n[0])}var a=s.Base64.encode(i);return this.urlGar.replace("ID_ETAB",e).replace("ID_ENT",a)}return"https://edumalin.fr/"},t.prototype.trackEvent=function(t){if(t&&t.length>0){var e={"event-type":t,modal:"Timeline"};(0,s.http)().post("/infra/event/web/store",e).catch(function(t){console.debug("[TrackingInternal] failed to trackEvent: ",t)})}},t.prototype.encodeUrlPicture=function(t){return encodeURI(t)},t}(),d=function(){function t(){this.restrict="E",this.template=n(1891).Z,this.scope={},this.bindToController=!0,this.controller=[o],this.controllerAs="ctrl",this.require=["odeEdumalinWidget"]}return t.prototype.link=function(t,e,n,a){return i(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return(e=a?a[0]:null)?[4,(0,s.http)().get("/appregistry/edumalin/widget").then(function(n){n.success?(e.data=n.data,t.$apply()):e.error=n.error})]:[2];case 1:return n.sent(),[2]}})})},t}();(0,s.notif)().onLangReady().promise.then(function(t){(0,s.conf)().Platform.idiom.addKeys(n(7918))}),e.odeModuleName="odeEdumalinWidgetModule",l.default.module(e.odeModuleName,[]).directive("odeEdumalinWidget",function(){return new d})},7918:t=>{t.exports=JSON.parse('{"edumalin.title":"Édumalin","edumalin.acceder":"Accéder à Édumalin","edumalin.empty":"Aucun résultat","edumalin.webinaire.date":"Date","edumalin.webinaire.duration":"Duration"}')}}]);
2
2
  //# sourceMappingURL=edumalin-widget.widget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"widgets/edumalin-widget/edumalin-widget.widget.js","mappings":"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","sources":["webpack://ode-ngjs-front/./src/ts/widgets/edumalin-widget/edumalin-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/edumalin-widget/edumalin-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \" <style>.widget-dashboard .dashboard-list .item:nth-child(2n){background:#fafafa}</style> <div class=\\\"widget-dashboard\\\"> <div class=\\\"widget-header\\\" style=\\\"border:0\\\"> <div class=\\\"subtitle\\\"> <a class=\\\"seemore\\\" href=\\\"#\\\" ng-click=\\\"ctrl.onButtonClick(ctrl.generateLinkGar(), 'EDUMALIN_OPEN_GAR')\\\" style=\\\"display:flex\\\"> <img src=\\\"/assets/widgets/edumalin-widget/edumalin.png\\\" width=\\\"40\\\" height=\\\"40\\\" alt=\\\"edumalin\\\"/> <span style=\\\"padding-left:20px\\\"><i18n>edumalin.title</i18n></span> </a> </div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\" title=\\\"Déplacer le widget\\\"> <i class=\\\"fas fa-grip-vertical\\\" aria-hidden=\\\"true\\\"></i> </div> </div> </div> <div class=\\\"widget-body\\\" dnd-nodrag> <div ng-if=\\\"!ctrl.isDataLoaded\\\" class=\\\"widget-empty-message\\\"> <div class=\\\"row row-cols-1 align-items-center\\\"> <div class=\\\"mb-3\\\"> <div class=\\\"widget-empty-message\\\" ng-if=\\\"ctrl.userEvents === undefined || ctrl.userEvents.length === 0\\\"> <i18n>edumalin.empty</i18n> </div> </div> </div> </div> <ul class=\\\"dashboard-list\\\" ng-if=\\\"ctrl.isDataLoaded\\\"> <li class=\\\"item link-discret\\\" ng-repeat=\\\"widget in ctrl.data\\\" ng-click=\\\"ctrl.openLightBox(widget, $event)\\\"> <a href=\\\"#\\\" class=\\\"item-inner\\\"> <div class=\\\"row\\\"> <div class=\\\"col-3 mt-16\\\"> <img ng-if=\\\"!ctrl.isURL(widget.picture)\\\" src=\\\"/assets/widgets/edumalin-widget/edumalin.png\\\" width=\\\"40\\\" height=\\\"40\\\" alt=\\\"edumalin\\\" class=\\\"m-auto\\\"/> <img ng-if=\\\"ctrl.isURL(widget.picture)\\\" ng-src=\\\"{{ctrl.encodeUrlPicture(widget.picture)}}\\\" width=\\\"60\\\" height=\\\"60\\\" alt=\\\"edumalin\\\" class=\\\"m-auto\\\"/> </div> <div class=\\\"col-9\\\"> <div class=\\\"subtitle\\\" translate content=\\\"[[widget.title]]\\\"></div> <div class=\\\"subtext\\\" translate ng-if=\\\"widget.description\\\" content=\\\"[[widget.description.length>70 ? widget.description.slice(0, 70) + ' ...' : widget.description]]\\\"></div> <div class=\\\"info meta\\\" ng-style=\\\"{'color': ctrl.displayIconColor(widget.type.name)}\\\" ng-if=\\\"widget.type\\\"> <i class=\\\"fas [[ctrl.displayIcon(widget.type.name)]]\\\"></i> [[widget.type.name]] </div> </div> </div> </a> </li> </ul> </div> <ode-modal visible=\\\"ctrl.showLightbox\\\" on-close=\\\"ctrl.showLightbox=false\\\" size=\\\"lg\\\" class=\\\"modal-widget\\\"> <ode-modal-title> <h2 translate content=\\\"[[ctrl.currentWidget.title]]\\\"></h2> </ode-modal-title> <ode-modal-body> <div class=\\\"container\\\"> <div class=\\\"row\\\"> <div class=\\\"col-md-4 col-sm-12\\\"> <img ng-if=\\\"!ctrl.isURL(ctrl.currentWidget.picture)\\\" src=\\\"/assets/widgets/edumalin-widget/edumalin.png\\\" width=\\\"200\\\" height=\\\"200\\\" alt=\\\"edumalin\\\" class=\\\"m-auto\\\"/> <img ng-if=\\\"ctrl.isURL(ctrl.currentWidget.picture)\\\" ng-src=\\\"{{ctrl.encodeUrlPicture(ctrl.currentWidget.picture)}}\\\" width=\\\"200\\\" height=\\\"200\\\" alt=\\\"edumalin\\\" class=\\\"m-auto\\\"/> </div> <div class=\\\"col-md-8 col-sm-12\\\"> <div class=\\\"label\\\" translate content=\\\"[[ctrl.currentWidget.description]]\\\"></div> <div class=\\\"mb-3 mt-12\\\" ng-if=\\\"ctrl.isTypeRDV(ctrl.currentWidget.type.name)\\\" ng-style=\\\"{'color': ctrl.displayIconColor(ctrl.currentWidget.type.name)}\\\"> <a href=\\\"[[ctrl.currentWidget.googleMap]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\"> <div class=\\\"label\\\"> <i class=\\\"fas [[ctrl.displayIcon(ctrl.currentWidget.type.name)]]\\\"></i> <span translate content=\\\"[[ctrl.currentWidget.type.name]]\\\"></span> </div> </a> </div> <div class=\\\"mb-3 mt-12\\\" ng-if=\\\"!ctrl.isTypeRDV(ctrl.currentWidget.type.name)\\\"> <div class=\\\"label\\\"> <i class=\\\"fas [[ctrl.displayIcon(ctrl.currentWidget.type.name)]]\\\" ng-style=\\\"{'color': ctrl.displayIconColor(ctrl.currentWidget.type.name)}\\\"></i> <span translate content=\\\"[[ctrl.currentWidget.type.name]]\\\" ng-style=\\\"{'color': ctrl.displayIconColor(ctrl.currentWidget.type.name)}\\\"></span> <span ng-if=\\\"ctrl.isTypeWebinaire(ctrl.currentWidget.type.name)\\\"> | <i18n>edumalin.webinaire.date</i18n>: [[ctrl.dateFormat(ctrl.currentWidget.dateTime)]] | <i18n>edumalin.webinaire.duration</i18n>: [[ctrl.currentWidget.duration]] min</span> </div> </div> </div> </div> </div> <div class=\\\"d-flex justify-content-end\\\"> <button type=\\\"button\\\" class=\\\"btn btn-outline-primary ng-binding ng-scope\\\" ng-click=\\\"ctrl.onButtonClick(ctrl.generateLinkGar(), 'EDUMALIN_OPEN_GAR')\\\" style=\\\"margin-right:1%\\\" translate content=\\\"edumalin.acceder\\\"/> <button ng-if=\\\"ctrl.currentWidget.buttonLink\\\" type=\\\"button\\\" class=\\\"btn btn-primary ng-binding ng-scope\\\" ng-click=\\\"ctrl.onButtonClick(ctrl.currentWidget.buttonLink, 'EDUMALIN_OPEN_LINK')\\\" translate> {{ctrl.currentWidget.buttonTitle}} </button> </div> </ode-modal-body> </ode-modal> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { conf, notif, http, session, Base64 } from \"../../utils\";\nimport moment from \"moment\";\n\nclass Controller implements IController {\n data: any = {};\n error: any = null;\n public currentWidget: any;\n public showLightbox = false;\n\n urlGar: string =\n \"https://idp-auth.gar.education.fr/domaineGar?idENT=ID_ENT&idEtab=ID_ETAB&idRessource=ark:/19496/UVdpWxn8N78r24\";\n\n onButtonClick(link: string, eventType: String) {\n // Track this event.\n if (eventType && eventType.length > 0) {\n this.trackEvent(eventType);\n }\n\n window.open(link, \"_blank\");\n }\n\n protected get isDataLoaded() {\n return this.data.length > 0;\n }\n\n dateFormat(dateTime: any) {\n let date = moment(dateTime).format(\"L\");\n return date;\n }\n\n isTypeRDV(type: any) {\n return type == \"RDV\";\n }\n\n isTypeWebinaire(type: any) {\n return type == \"Webinaire\";\n }\n\n displayIcon(type: any) {\n switch (type) {\n case \"RDV\":\n return \"fa-calendar-alt\";\n case \"Webinaire\":\n return \"fa-video\";\n case \"Annonce\":\n return \"fa-bullhorn\";\n case \"Actualité\":\n return \"fa-newspaper\";\n case \"Temoignage\":\n return \"fa-microphone-lines\";\n case \"Podcast\":\n return \"fa-headset\";\n case \"Replay\":\n return \"fa-rotate-left\";\n case \"Tutoriel\":\n return \"fa-wand-magic-sparkles\";\n default:\n return \"fa-info\";\n }\n }\n\n displayIconColor(type: any) {\n switch (type) {\n case \"RDV\":\n return \"#2a9cc8\";\n case \"Webinaire\":\n return \"#20c997\";\n case \"Annonce\":\n return \"#E13A3A\";\n case \"Actualité\":\n return \"#FF8D2E\";\n case \"Temoignage\":\n return \"#2029B6\";\n case \"Podcast\":\n return \"#823AA1\";\n case \"Replay\":\n return \"#46BFAF\";\n case \"Tutoriel\":\n return \"#ecbe30\";\n default:\n return \"#f59700\";\n }\n }\n\n openLightBox(contentType: any, e: Event) {\n this.currentWidget = contentType;\n this.showLightbox = true;\n\n // Track this event.\n if (e.currentTarget) {\n this.trackEvent(\"EDUMALIN_OPEN_MODAL\");\n }\n }\n\n isURL(str: String) {\n if (\n str &&\n str.length > 0 &&\n (str.startsWith(\"http://\") || str.startsWith(\"https://\"))\n ) {\n return true;\n }\n return false;\n }\n\n generateLinkGar() {\n if (\n session().description &&\n session().description.schools &&\n session().description.schools.length > 0\n ) {\n let school = session().description.schools[0];\n let UAIb64: string = Base64.encode(school?.UAI != null ? school.UAI : \"\");\n let exports: string[] = school.exports != null ? school.exports : [];\n let codeGar = \"\";\n if (exports != null) {\n for (let i = 0; i < exports.length; ++i)\n if (exports[i].startsWith(\"GAR-\")) {\n codeGar = exports[i].replace(\"GAR-\", \"\");\n break;\n }\n if (codeGar == \"\") codeGar = exports[0];\n }\n let codeGARb64 = Base64.encode(codeGar);\n\n return this.urlGar\n .replace(\"ID_ETAB\", UAIb64)\n .replace(\"ID_ENT\", codeGARb64);\n }\n\n return \"https://edumalin.fr/\";\n }\n\n // Give an opportunity to track some events from outside of this component.\n protected trackEvent(eventType: String) {\n // Track this event.\n if (eventType && eventType.length > 0) {\n const eventJson: any = {\n \"event-type\": eventType,\n modal: \"Timeline\",\n };\n\n http()\n .post(\"/infra/event/web/store\", eventJson)\n .catch((e) => {\n console.debug(\"[TrackingInternal] failed to trackEvent: \", e);\n });\n }\n }\n\n encodeUrlPicture(url: string) {\n return encodeURI(url);\n }\n}\n\n/* Directive */\nclass Directive\n implements IDirective<IScope, JQLite, IAttributes, IController[]>\n{\n restrict = \"E\";\n template = require(\"./edumalin-widget.widget.html\").default;\n scope = {};\n bindToController = true;\n controller = [Controller];\n controllerAs = \"ctrl\";\n require = [\"odeEdumalinWidget\"];\n\n async link(\n scope: IScope,\n elem: JQLite,\n attrs: IAttributes,\n controllers?: IController[]\n ) {\n const ctrl: Controller | null = controllers\n ? (controllers[0] as Controller)\n : null;\n if (!ctrl) {\n return;\n }\n\n await http()\n .get(\"/appregistry/edumalin/widget\")\n .then((response) => {\n if (response.success) {\n ctrl.data = response.data;\n scope.$apply();\n } else {\n ctrl.error = response.error;\n }\n });\n }\n}\n\n/** The edumalin widget. */\nfunction DirectiveFactory() {\n return new Directive();\n}\n\n// Preload translations\nnotif()\n .onLangReady()\n .promise.then((lang) => {\n switch (lang) {\n default:\n conf().Platform.idiom.addKeys(require(\"./i18n/fr.json\"));\n break;\n }\n });\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeEdumalinWidgetModule\";\nangular\n .module(odeModuleName, [])\n .directive(\"odeEdumalinWidget\", DirectiveFactory);\n"],"names":["data","error","showLightbox","urlGar","onButtonClick","link","eventType","length","this","trackEvent","window","open","dateFormat","dateTime","format","isTypeRDV","type","isTypeWebinaire","displayIcon","displayIconColor","openLightBox","contentType","e","currentWidget","currentTarget","isURL","str","startsWith","generateLinkGar","session","description","schools","school","UAIb64","Base64","encode","UAI","exports","codeGar","i","replace","codeGARb64","eventJson","modal","http","post","catch","console","debug","encodeUrlPicture","url","encodeURI","restrict","template","scope","bindToController","controller","Controller","controllerAs","require","elem","attrs","controllers","ctrl","get","then","response","success","$apply","notif","onLangReady","promise","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
1
+ {"version":3,"file":"widgets/edumalin-widget/edumalin-widget.widget.js","mappings":"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","sources":["webpack://ode-ngjs-front/./src/ts/widgets/edumalin-widget/edumalin-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/edumalin-widget/edumalin-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \" <style>.widget-dashboard .dashboard-list .item:nth-child(2n){background:#fafafa}</style> <div class=\\\"widget-dashboard\\\"> <div class=\\\"widget-header\\\" style=\\\"border:0\\\"> <div class=\\\"subtitle\\\"> <a class=\\\"seemore\\\" href=\\\"#\\\" ng-click=\\\"ctrl.onButtonClick(ctrl.generateLinkGar(), 'EDUMALIN_OPEN_GAR')\\\" style=\\\"display:flex\\\"> <img src=\\\"/assets/widgets/edumalin-widget/edumalin.png\\\" width=\\\"40\\\" height=\\\"40\\\" alt=\\\"edumalin\\\"/> <span style=\\\"padding-left:20px\\\"><i18n>edumalin.title</i18n></span> </a> </div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\" title=\\\"Déplacer le widget\\\"> <i class=\\\"fas fa-grip-vertical\\\" aria-hidden=\\\"true\\\"></i> </div> </div> </div> <div class=\\\"widget-body\\\" dnd-nodrag> <div ng-if=\\\"!ctrl.isDataLoaded\\\" class=\\\"widget-empty-message\\\"> <div class=\\\"row row-cols-1 align-items-center\\\"> <div class=\\\"mb-3\\\"> <div class=\\\"widget-empty-message\\\" ng-if=\\\"ctrl.userEvents === undefined || ctrl.userEvents.length === 0\\\"> <i18n>edumalin.empty</i18n> </div> </div> </div> </div> <ul class=\\\"dashboard-list\\\" ng-if=\\\"ctrl.isDataLoaded\\\"> <li class=\\\"item link-discret\\\" ng-repeat=\\\"widget in ctrl.data\\\" ng-click=\\\"ctrl.openLightBox(widget, $event)\\\"> <a href=\\\"#\\\" class=\\\"item-inner\\\"> <div class=\\\"row\\\"> <div class=\\\"col-3 mt-16\\\"> <img ng-if=\\\"!ctrl.isURL(widget.picture)\\\" src=\\\"/assets/widgets/edumalin-widget/edumalin.png\\\" width=\\\"40\\\" height=\\\"40\\\" alt=\\\"edumalin\\\" class=\\\"m-auto\\\"/> <img ng-if=\\\"ctrl.isURL(widget.picture)\\\" ng-src=\\\"{{ctrl.encodeUrlPicture(widget.picture)}}\\\" width=\\\"60\\\" height=\\\"60\\\" alt=\\\"edumalin\\\" class=\\\"m-auto\\\"/> </div> <div class=\\\"col-9\\\"> <div class=\\\"subtitle\\\" translate content=\\\"[[widget.title]]\\\"></div> <div class=\\\"subtext\\\" translate ng-if=\\\"widget.description\\\" content=\\\"[[widget.description.length>70 ? widget.description.slice(0, 70) + ' ...' : widget.description]]\\\"></div> <div class=\\\"info meta\\\" ng-style=\\\"{'color': ctrl.displayIconColor(widget.type.name)}\\\" ng-if=\\\"widget.type\\\"> <i class=\\\"fas [[ctrl.displayIcon(widget.type.name)]]\\\"></i> [[widget.type.name]] </div> </div> </div> </a> </li> </ul> </div> <ode-modal visible=\\\"ctrl.showLightbox\\\" on-close=\\\"ctrl.showLightbox=false\\\" size=\\\"lg\\\" class=\\\"modal-widget\\\"> <ode-modal-title> <h2 translate content=\\\"[[ctrl.currentWidget.title]]\\\"></h2> </ode-modal-title> <ode-modal-body> <div class=\\\"container\\\"> <div class=\\\"row\\\"> <div class=\\\"col-md-4 col-sm-12\\\"> <img ng-if=\\\"!ctrl.isURL(ctrl.currentWidget.picture)\\\" src=\\\"/assets/widgets/edumalin-widget/edumalin.png\\\" width=\\\"200\\\" height=\\\"200\\\" alt=\\\"edumalin\\\" class=\\\"m-auto\\\"/> <img ng-if=\\\"ctrl.isURL(ctrl.currentWidget.picture)\\\" ng-src=\\\"{{ctrl.encodeUrlPicture(ctrl.currentWidget.picture)}}\\\" width=\\\"200\\\" height=\\\"200\\\" alt=\\\"edumalin\\\" class=\\\"m-auto\\\"/> </div> <div class=\\\"col-md-8 col-sm-12\\\"> <div class=\\\"label\\\" translate content=\\\"[[ctrl.currentWidget.description]]\\\"></div> <div class=\\\"mb-3 mt-12\\\" ng-if=\\\"ctrl.isTypeRDV(ctrl.currentWidget.type.name)\\\" ng-style=\\\"{'color': ctrl.displayIconColor(ctrl.currentWidget.type.name)}\\\"> <a href=\\\"[[ctrl.currentWidget.googleMap]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\"> <div class=\\\"label\\\"> <i class=\\\"fas [[ctrl.displayIcon(ctrl.currentWidget.type.name)]]\\\"></i> <span translate content=\\\"[[ctrl.currentWidget.type.name]]\\\"></span> </div> </a> </div> <div class=\\\"mb-3 mt-12\\\" ng-if=\\\"!ctrl.isTypeRDV(ctrl.currentWidget.type.name)\\\"> <div class=\\\"label\\\"> <i class=\\\"fas [[ctrl.displayIcon(ctrl.currentWidget.type.name)]]\\\" ng-style=\\\"{'color': ctrl.displayIconColor(ctrl.currentWidget.type.name)}\\\"></i> <span translate content=\\\"[[ctrl.currentWidget.type.name]]\\\" ng-style=\\\"{'color': ctrl.displayIconColor(ctrl.currentWidget.type.name)}\\\"></span> <span ng-if=\\\"ctrl.isTypeWebinaire(ctrl.currentWidget.type.name)\\\"> | <i18n>edumalin.webinaire.date</i18n>: [[ctrl.dateFormat(ctrl.currentWidget.dateTime)]] | <i18n>edumalin.webinaire.duration</i18n>: [[ctrl.currentWidget.duration]] min</span> </div> </div> </div> </div> </div> <div class=\\\"d-flex justify-content-end\\\"> <button type=\\\"button\\\" class=\\\"btn btn-outline-primary ng-binding ng-scope\\\" ng-click=\\\"ctrl.onButtonClick(ctrl.generateLinkGar(), 'EDUMALIN_OPEN_GAR')\\\" style=\\\"margin-right:1%\\\" translate content=\\\"edumalin.acceder\\\"/> <button ng-if=\\\"ctrl.currentWidget.buttonLink\\\" type=\\\"button\\\" class=\\\"btn btn-primary ng-binding ng-scope\\\" ng-click=\\\"ctrl.onButtonClick(ctrl.currentWidget.buttonLink, 'EDUMALIN_OPEN_LINK')\\\" translate> {{ctrl.currentWidget.buttonTitle}} </button> </div> </ode-modal-body> </ode-modal> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { conf, notif, http, session, Base64 } from \"../../utils\";\nimport moment from \"moment\";\n\nclass Controller implements IController {\n data: any = {};\n error: any = null;\n public currentWidget: any;\n public showLightbox = false;\n\n urlGar: string =\n \"https://idp-auth.gar.education.fr/domaineGar?idENT=ID_ENT&idEtab=ID_ETAB&idRessource=ark:/19496/UVdpWxn8N78r24\";\n\n onButtonClick(link: string, eventType: String) {\n // Track this event.\n if (eventType && eventType.length > 0) {\n this.trackEvent(eventType);\n }\n\n window.open(link, \"_blank\");\n }\n\n protected get isDataLoaded() {\n return this.data.length > 0;\n }\n\n dateFormat(dateTime: any) {\n let date = moment(dateTime).format(\"L\");\n return date;\n }\n\n isTypeRDV(type: any) {\n return type == \"RDV\";\n }\n\n isTypeWebinaire(type: any) {\n return type == \"Webinaire\";\n }\n\n displayIcon(type: any) {\n switch (type) {\n case \"RDV\":\n return \"fa-calendar-alt\";\n case \"Webinaire\":\n return \"fa-video\";\n case \"Annonce\":\n return \"fa-bullhorn\";\n case \"Actualité\":\n return \"fa-newspaper\";\n case \"Temoignage\":\n return \"fa-microphone-lines\";\n case \"Podcast\":\n return \"fa-headset\";\n case \"Replay\":\n return \"fa-rotate-left\";\n case \"Tutoriel\":\n return \"fa-wand-magic-sparkles\";\n default:\n return \"fa-info\";\n }\n }\n\n displayIconColor(type: any) {\n switch (type) {\n case \"RDV\":\n return \"#2a9cc8\";\n case \"Webinaire\":\n return \"#20c997\";\n case \"Annonce\":\n return \"#E13A3A\";\n case \"Actualité\":\n return \"#FF8D2E\";\n case \"Temoignage\":\n return \"#2029B6\";\n case \"Podcast\":\n return \"#823AA1\";\n case \"Replay\":\n return \"#46BFAF\";\n case \"Tutoriel\":\n return \"#ecbe30\";\n default:\n return \"#f59700\";\n }\n }\n\n openLightBox(contentType: any, e: Event) {\n this.currentWidget = contentType;\n this.showLightbox = true;\n\n // Track this event.\n if (e.currentTarget) {\n this.trackEvent(\"EDUMALIN_OPEN_MODAL\");\n }\n }\n\n isURL(str: String) {\n if (\n str &&\n str.length > 0 &&\n (str.startsWith(\"http://\") || str.startsWith(\"https://\"))\n ) {\n return true;\n }\n return false;\n }\n\n generateLinkGar() {\n if (\n session().description &&\n session().description.schools &&\n session().description.schools.length > 0\n ) {\n let school = session().description.schools[0];\n let UAIb64: string = Base64.encode(school?.UAI != null ? school.UAI : \"\");\n let exports: string[] = school.exports != null ? school.exports : [];\n let codeGar = \"\";\n if (exports != null) {\n for (let i = 0; i < exports.length; ++i)\n if (exports[i].startsWith(\"GAR-\")) {\n codeGar = exports[i].replace(\"GAR-\", \"\");\n break;\n }\n if (codeGar == \"\") codeGar = exports[0];\n }\n let codeGARb64 = Base64.encode(codeGar);\n\n return this.urlGar\n .replace(\"ID_ETAB\", UAIb64)\n .replace(\"ID_ENT\", codeGARb64);\n }\n\n return \"https://edumalin.fr/\";\n }\n\n // Give an opportunity to track some events from outside of this component.\n protected trackEvent(eventType: String) {\n // Track this event.\n if (eventType && eventType.length > 0) {\n const eventJson: any = {\n \"event-type\": eventType,\n modal: \"Timeline\",\n };\n\n http()\n .post(\"/infra/event/web/store\", eventJson)\n .catch((e) => {\n console.debug(\"[TrackingInternal] failed to trackEvent: \", e);\n });\n }\n }\n\n encodeUrlPicture(url: string) {\n return encodeURI(url);\n }\n}\n\n/* Directive */\nclass Directive\n implements IDirective<IScope, JQLite, IAttributes, IController[]>\n{\n restrict = \"E\";\n template = require(\"./edumalin-widget.widget.html\").default;\n scope = {};\n bindToController = true;\n controller = [Controller];\n controllerAs = \"ctrl\";\n require = [\"odeEdumalinWidget\"];\n\n async link(\n scope: IScope,\n elem: JQLite,\n attrs: IAttributes,\n controllers?: IController[]\n ) {\n const ctrl: Controller | null = controllers\n ? (controllers[0] as Controller)\n : null;\n if (!ctrl) {\n return;\n }\n\n await http()\n .get(\"/appregistry/edumalin/widget\")\n .then((response) => {\n if (response.success) {\n ctrl.data = response.data;\n scope.$apply();\n } else {\n ctrl.error = response.error;\n }\n });\n }\n}\n\n/** The edumalin widget. */\nfunction DirectiveFactory() {\n return new Directive();\n}\n\n// Preload translations\nnotif()\n .onLangReady()\n .promise.then((lang) => {\n switch (lang) {\n default:\n conf().Platform.idiom.addKeys(require(\"./i18n/fr.json\"));\n break;\n }\n });\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeEdumalinWidgetModule\";\nangular\n .module(odeModuleName, [])\n .directive(\"odeEdumalinWidget\", DirectiveFactory);\n"],"names":["data","error","showLightbox","urlGar","onButtonClick","link","eventType","length","this","trackEvent","window","open","dateFormat","dateTime","format","isTypeRDV","type","isTypeWebinaire","displayIcon","displayIconColor","openLightBox","contentType","e","currentWidget","currentTarget","isURL","str","startsWith","generateLinkGar","session","description","schools","school","UAIb64","Base64","encode","UAI","exports","codeGar","i","replace","codeGARb64","eventJson","modal","http","post","catch","console","debug","encodeUrlPicture","url","encodeURI","restrict","template","scope","bindToController","controller","Controller","controllerAs","require","elem","attrs","controllers","ctrl","get","then","response","success","$apply","notif","onLangReady","promise","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[376],{1918:(t,i,e)=>{e.d(i,{Z:()=>n});const n=' <div class="widget-news"> <div class="widget-header"> <div class="subtitle"> <a class="seemore" href="/actualites" i18n-title="last-infos-widget.widget.see.all" dnd-nodrag ng-click="trackEvent($event, { detail:{\'open\':\'app\'} })"> <i18n>last-infos-widget.widget.title</i18n> <span class="seemore-text"><i18n>last-infos-widget.widget.see.more</i18n></span> </a> </div> <div class="widget-options"> <div class="widget-handle" title="Déplacer le widget"><i class="fas fa-grip-vertical" aria-hidden="true"></i></div> </div> </div> <div class="widget-body" dnd-nodrag> <div class="widget-empty-message" ng-if="ctrl.infos === undefined || ctrl.infos.length === 0"> <i18n>last-infos-widget.widget.empty</i18n> </div> <a class="news-row" ng-repeat="info in ctrl.infos track by info._id" ng-href="/actualites#/view/thread/[[info.thread_id]]/info/[[info._id]]" ng-click="trackEvent($event, {detail:{\'open\':\'info\'} })"> <div class="news-row-image"> <img ng-if="!info.thread_icon" skin-src="/img/illustrations/news.svg" alt="[[info.thread_title]]" width="40" height="40"/> <img ng-if="info.thread_icon" ng-src="[[info.thread_icon]]?thumbnail=120x120" alt="[[info.thread_title]]" width="40" height="40"/> </div> <div class="news-row-text"> <span class="link d-block">[[info.title]]</span> <span class="meta">[[info.relativeDate]] - [[info.username]]</span> </div> </a> </div> </div> '},5479:function(t,i,e){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i,"__esModule",{value:!0}),i.odeModuleName=void 0;var s=n(e(4202)),o=e(9419),a=e(5262),d=function(){function t(){this.widget=new a.LastInfosWidget,this.lang=(0,o.conf)().Platform.idiom,this.infos=[],this.resultSizeValues=[1,2,3,4,5,6,7,8,9,10],this.resultSize=4,this.display={edition:!1}}return t.prototype.load=function(){var t=this;return this.widget.loadInfos(this.resultSize).then((function(i){t.infos=i.map((function(i){return i.relativeDate=o.L10n.moment(i.date).fromNow(),i.tooltip=t.lang.translate("last-infos-widget.widget.thread")+" : "+i.thread_title+" | "+t.lang.translate("last-infos-widget.widget.author")+" : "+i.username,i}))}))},t.prototype.openConfig=function(){this.display.edition=!0},t.prototype.closeConfig=function(){this.display.edition=!1},t.prototype.saveConfig=function(){return this.widget.setMaxResults(this.resultSize)},t}(),l=function(){function t(){this.restrict="E",this.template=e(1918).Z,this.controller=[d],this.controllerAs="ctrl",this.require=["odeLastInfosWidget"]}return t.prototype.link=function(t,i,e,n){var s=n?n[0]:null;s&&(t.trackEvent=function(t,i){var e,n;void 0===i.bubbles&&(i.bubbles=!0);var s=null;(i&&"app"===(null===(e=i.detail)||void 0===e?void 0:e.open)||i&&"info"===(null===(n=i.detail)||void 0===n?void 0:n.open))&&(s=new CustomEvent(o.TrackedActionFromWidget.lastInfos,i)),s&&t.currentTarget&&t.currentTarget.dispatchEvent(s)},s.widget.getMaxResults().then((function(i){s.resultSize=i,s.load().then((function(){t.$apply()}))})))},t}();(0,o.notif)().onLangReady().promise.then((function(t){(0,o.conf)().Platform.idiom.addKeys(e(723))})),i.odeModuleName="odeLastInfosWidgetModule",s.default.module(i.odeModuleName,[]).directive("odeLastInfosWidget",(function(){return new l}))},723:t=>{t.exports=JSON.parse('{"last-infos-widget.widget.title":"Actualités","last-infos-widget.widget.author":"Auteur","last-infos-widget.widget.bad.request.invalid.size":"Nombre d\'actualités invalide : veuillez choisir un nombre compris entre 1 et 20.","last-infos-widget.widget.bad.request.size.must.be.an.integer":"Nombre d\'actualités invalide : veuillez utiliser un nombre.","last-infos-widget.widget.config":"Configurer","last-infos-widget.widget.config.cancel":"Annuler","last-infos-widget.widget.config.nbr":"Nombre d\'actualités à afficher","last-infos-widget.widget.config.save":"Enregistrer","last-infos-widget.widget.config.title":"Configuration","last-infos-widget.widget.empty":"Aucune actualité","last-infos-widget.widget.thread":"Fil","last-infos-widget.widget.see.all":"Voir toutes les actualités","last-infos-widget.widget.see.more":"voir plus","last-infos-widget.widget.options":"Options du widget"}')}}]);
1
+ "use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[376],{1918:(t,i,e)=>{e.d(i,{Z:()=>n});const n=' <div class="widget-news"> <div class="widget-header"> <div class="subtitle"> <a class="seemore" href="/actualites" i18n-title="last-infos-widget.widget.see.all" dnd-nodrag ng-click="trackEvent($event, { detail:{\'open\':\'app\'} })"> <i18n>last-infos-widget.widget.title</i18n> <span class="seemore-text"><i18n>last-infos-widget.widget.see.more</i18n></span> </a> </div> <div class="widget-options"> <div class="widget-handle" title="Déplacer le widget"><i class="fas fa-grip-vertical" aria-hidden="true"></i></div> </div> </div> <div class="widget-body" dnd-nodrag> <div class="widget-empty-message" ng-if="ctrl.infos === undefined || ctrl.infos.length === 0"> <i18n>last-infos-widget.widget.empty</i18n> </div> <a class="news-row" ng-repeat="info in ctrl.infos track by info._id" ng-href="/actualites#/view/thread/[[info.thread_id]]/info/[[info._id]]" ng-click="trackEvent($event, {detail:{\'open\':\'info\'} })"> <div class="news-row-image"> <img ng-if="!info.thread_icon" skin-src="/img/illustrations/news.svg" alt="[[info.thread_title]]" width="40" height="40"/> <img ng-if="info.thread_icon" ng-src="[[info.thread_icon]]?thumbnail=120x120" alt="[[info.thread_title]]" width="40" height="40"/> </div> <div class="news-row-text"> <span class="link d-block">[[info.title]]</span> <span class="meta">[[info.relativeDate]] - [[info.username]]</span> </div> </a> </div> </div> '},5479:function(t,i,e){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i,"__esModule",{value:!0}),i.odeModuleName=void 0;var s=n(e(4202)),o=e(9419),a=e(5262),d=function(){function t(){this.widget=new a.LastInfosWidget,this.lang=(0,o.conf)().Platform.idiom,this.infos=[],this.resultSizeValues=[1,2,3,4,5,6,7,8,9,10],this.resultSize=4,this.display={edition:!1}}return t.prototype.load=function(){var t=this;return this.widget.loadInfos(this.resultSize).then(function(i){t.infos=i.map(function(i){return i.relativeDate=o.L10n.moment(i.date).fromNow(),i.tooltip=t.lang.translate("last-infos-widget.widget.thread")+" : "+i.thread_title+" | "+t.lang.translate("last-infos-widget.widget.author")+" : "+i.username,i})})},t.prototype.openConfig=function(){this.display.edition=!0},t.prototype.closeConfig=function(){this.display.edition=!1},t.prototype.saveConfig=function(){return this.widget.setMaxResults(this.resultSize)},t}(),l=function(){function t(){this.restrict="E",this.template=e(1918).Z,this.controller=[d],this.controllerAs="ctrl",this.require=["odeLastInfosWidget"]}return t.prototype.link=function(t,i,e,n){var s=n?n[0]:null;s&&(t.trackEvent=function(t,i){var e,n;void 0===i.bubbles&&(i.bubbles=!0);var s=null;(i&&"app"===(null===(e=i.detail)||void 0===e?void 0:e.open)||i&&"info"===(null===(n=i.detail)||void 0===n?void 0:n.open))&&(s=new CustomEvent(o.TrackedActionFromWidget.lastInfos,i)),s&&t.currentTarget&&t.currentTarget.dispatchEvent(s)},s.widget.getMaxResults().then(function(i){s.resultSize=i,s.load().then(function(){t.$apply()})}))},t}();(0,o.notif)().onLangReady().promise.then(function(t){(0,o.conf)().Platform.idiom.addKeys(e(723))}),i.odeModuleName="odeLastInfosWidgetModule",s.default.module(i.odeModuleName,[]).directive("odeLastInfosWidget",function(){return new l})},723:t=>{t.exports=JSON.parse('{"last-infos-widget.widget.author":"Auteur","last-infos-widget.widget.bad.request.invalid.size":"Nombre d\'actualités invalide : veuillez choisir un nombre compris entre 1 et 20.","last-infos-widget.widget.bad.request.size.must.be.an.integer":"Nombre d\'actualités invalide : veuillez utiliser un nombre.","last-infos-widget.widget.config":"Configurer","last-infos-widget.widget.config.cancel":"Annuler","last-infos-widget.widget.config.nbr":"Nombre d\'actualités à afficher","last-infos-widget.widget.config.save":"Enregistrer","last-infos-widget.widget.config.title":"Configuration","last-infos-widget.widget.empty":"Aucune actualité","last-infos-widget.widget.options":"Options du widget","last-infos-widget.widget.see.all":"Voir toutes les actualités","last-infos-widget.widget.see.more":"voir plus","last-infos-widget.widget.thread":"Fil","last-infos-widget.widget.title":"Actualités"}')}}]);
2
2
  //# sourceMappingURL=last-infos-widget.widget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"widgets/last-infos-widget/last-infos-widget.widget.js","mappings":"gIAGA,QAFW,o2C,mLCDX,iBACA,UACA,UAQA,0BACQ,KAAAA,OAAS,IAAI,EAAAC,gBACZ,KAAAC,MAAO,IAAAC,QAAOC,SAASC,MAExB,KAAAC,MAAkC,GAClC,KAAAC,iBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IACtC,KAAAC,WAAa,EACb,KAAAC,QAAU,CAChBC,SAAS,EAyBX,QAtBC,YAAAC,KAAA,sBACC,OAAOC,KAAKZ,OAAOa,UAAWD,KAAKJ,YAAaM,MAAM,SAAAR,GACrD,EAAKA,MAAQA,EAAMS,KAAK,SAAAC,GAIvB,OAHCA,EAAiCC,aAAe,EAAAC,KAAKC,OAAOH,EAAKI,MAAMC,UACvEL,EAAiCM,QAAU,EAAKpB,KAAKqB,UAAU,mCAAqC,MAAQP,EAAKQ,aACjH,MAAQ,EAAKtB,KAAKqB,UAAU,mCAAqC,MAAQP,EAAKS,SACxET,CACR,GACD,GACD,EAEA,YAAAU,WAAA,WACCd,KAAKH,QAAQC,SAAU,CACxB,EAEA,YAAAiB,YAAA,WACCf,KAAKH,QAAQC,SAAU,CACxB,EAEA,YAAAkB,WAAA,WACC,OAAOhB,KAAKZ,OAAO6B,cAAejB,KAAKJ,WACxC,EACD,EAjCA,GAoCA,0BACI,KAAAsB,SAAW,IACd,KAAAC,SAAW,UACX,KAAAC,WAAa,CAACC,GACd,KAAAC,aAAe,OACZ,KAAAC,QAAU,CAAC,qBA6Bf,QA3BI,YAAAC,KAAA,SAAKC,EAAoBC,EAAaC,EAAmBC,GACrD,IAAMC,EAAuBD,EAAcA,EAAY,GAAmB,KAC1EC,IAGNJ,EAAMK,WAAa,SAACC,EAASC,G,aAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,MACRF,GAAsB,SAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,OAERJ,GAAsB,UAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,SADzBF,EAAQ,IAAIG,YAAa,EAAAC,wBAAwBC,UAAWP,IAIzDE,GAASH,EAAES,eACdT,EAAES,cAAcC,cAAcP,EAEhC,EAEAL,EAAKzC,OAAOsD,gBAAgBxC,MAAM,SAAAyC,GACjCd,EAAKjC,WAAa+C,EAClBd,EAAK9B,OAAOG,MAAM,WACjBuB,EAAMmB,QACP,GACD,IACD,EACD,EAlCA,IA8CA,IAAAC,SAAQC,cAAcC,QAAQ7C,MAAM,SAAAZ,IAEzB,IAAAC,QAAOC,SAASC,MAAMuD,QAAS,EAAQ,KAElD,IAIa,EAAAC,cAAgB,2BAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,sBAd9C,WACC,OAAO,IAAIC,CACZ,G","sources":["webpack://ode-ngjs-front/./src/ts/widgets/last-infos-widget/last-infos-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/last-infos-widget/last-infos-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \" <div class=\\\"widget-news\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"> <a class=\\\"seemore\\\" href=\\\"/actualites\\\" i18n-title=\\\"last-infos-widget.widget.see.all\\\" dnd-nodrag ng-click=\\\"trackEvent($event, { detail:{'open':'app'} })\\\"> <i18n>last-infos-widget.widget.title</i18n> <span class=\\\"seemore-text\\\"><i18n>last-infos-widget.widget.see.more</i18n></span> </a> </div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\" title=\\\"Déplacer le widget\\\"><i class=\\\"fas fa-grip-vertical\\\" aria-hidden=\\\"true\\\"></i></div> </div> </div> <div class=\\\"widget-body\\\" dnd-nodrag> <div class=\\\"widget-empty-message\\\" ng-if=\\\"ctrl.infos === undefined || ctrl.infos.length === 0\\\"> <i18n>last-infos-widget.widget.empty</i18n> </div> <a class=\\\"news-row\\\" ng-repeat=\\\"info in ctrl.infos track by info._id\\\" ng-href=\\\"/actualites#/view/thread/[[info.thread_id]]/info/[[info._id]]\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'info'} })\\\"> <div class=\\\"news-row-image\\\"> <img ng-if=\\\"!info.thread_icon\\\" skin-src=\\\"/img/illustrations/news.svg\\\" alt=\\\"[[info.thread_title]]\\\" width=\\\"40\\\" height=\\\"40\\\"/> <img ng-if=\\\"info.thread_icon\\\" ng-src=\\\"[[info.thread_icon]]?thumbnail=120x120\\\" alt=\\\"[[info.thread_title]]\\\" width=\\\"40\\\" height=\\\"40\\\"/> </div> <div class=\\\"news-row-text\\\"> <span class=\\\"link d-block\\\">[[info.title]]</span> <span class=\\\"meta\\\">[[info.relativeDate]] - [[info.username]]</span> </div> </a> </div> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective } from \"angular\";\nimport { L10n, conf, notif, TrackedAction, TrackedScope, TrackedActionFromWidget } from \"../../utils\";\nimport { ILastInfosModel, LastInfosWidget } from \"ode-ts-client\";\n\ninterface IExtendedLastInfosModel extends ILastInfosModel {\n\trelativeDate: string;\n\ttooltip: string;\n}\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tpublic widget = new LastInfosWidget();\n\tprivate lang = conf().Platform.idiom;\n\n\tpublic infos:IExtendedLastInfosModel[] = [];\n\tpublic resultSizeValues = [1,2,3,4,5,6,7,8,9,10];\n\tpublic resultSize = 4;\n\tpublic display = {\n\t\tedition: false\n\t};\n\n\tload():Promise<void> {\n\t\treturn this.widget.loadInfos( this.resultSize ).then( infos => {\n\t\t\tthis.infos = infos.map( info => {\n\t\t\t\t(info as IExtendedLastInfosModel).relativeDate = L10n.moment(info.date).fromNow();\n\t\t\t\t(info as IExtendedLastInfosModel).tooltip = this.lang.translate('last-infos-widget.widget.thread') + ' : ' + info.thread_title +\n\t\t\t\t\t' | ' + this.lang.translate('last-infos-widget.widget.author') + ' : ' + info.username;\n\t\t\t\treturn info as IExtendedLastInfosModel;\n\t\t\t});\n\t\t});\n\t};\n\t\n\topenConfig(){\n\t\tthis.display.edition = true;\n\t};\n\t\n\tcloseConfig(){\n\t\tthis.display.edition = false;\n\t};\n\t\n\tsaveConfig(){\n\t\treturn this.widget.setMaxResults( this.resultSize );\n\t};\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./last-infos-widget.widget.html').default;\n\tcontroller = [Controller];\n\tcontrollerAs = 'ctrl';\n require = ['odeLastInfosWidget'];\n\n link(scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]): void {\n const ctrl:Controller|null = controllers ? controllers[0] as Controller : null;\n\t\tif( ! ctrl ) return;\n\n\t\t// Give an opportunity to track some events from outside of this widget.\n\t\tscope.trackEvent = (e:Event, p:CustomEventInit<TrackedAction>) => {\n\t\t\t// Allow events to bubble up.\n\t\t\tif(typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n\t\t\tlet event = null;\n\t\t\tif( p && p.detail?.open==='app' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.lastInfos, p );\n\t\t\t} else if( p && p.detail?.open==='info' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.lastInfos, p );\n\t\t\t}\n\t\t\tif( event && e.currentTarget ) {\n\t\t\t\te.currentTarget.dispatchEvent(event);\n\t\t\t}\n\t\t}\n\n\t\tctrl.widget.getMaxResults().then( num => {\n\t\t\tctrl.resultSize = num;\n\t\t\tctrl.load().then( () => {\n\t\t\t\tscope.$apply();\n\t\t\t});\n\t\t});\n\t}\n}\n\n/** The last-infos widget.\n *\n * Usage:\n * &lt;ode-last-infos></ode-last-infos&gt;\n */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then( lang => {\n\tswitch( lang ) {\n\t\tdefault:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n\t}\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeLastInfosWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeLastInfosWidget\", DirectiveFactory );\n"],"names":["widget","LastInfosWidget","lang","conf","Platform","idiom","infos","resultSizeValues","resultSize","display","edition","load","this","loadInfos","then","map","info","relativeDate","L10n","moment","date","fromNow","tooltip","translate","thread_title","username","openConfig","closeConfig","saveConfig","setMaxResults","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","trackEvent","e","p","bubbles","event","detail","open","CustomEvent","TrackedActionFromWidget","lastInfos","currentTarget","dispatchEvent","getMaxResults","num","$apply","notif","onLangReady","promise","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
1
+ {"version":3,"file":"widgets/last-infos-widget/last-infos-widget.widget.js","mappings":"gIAGA,QAFW,o2C,mLCDX,iBACA,UACA,UAQA,0BACQ,KAAAA,OAAS,IAAI,EAAAC,gBACZ,KAAAC,MAAO,IAAAC,QAAOC,SAASC,MAExB,KAAAC,MAAkC,GAClC,KAAAC,iBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IACtC,KAAAC,WAAa,EACb,KAAAC,QAAU,CAChBC,SAAS,EAyBX,QAtBC,YAAAC,KAAA,sBACC,OAAOC,KAAKZ,OAAOa,UAAWD,KAAKJ,YAAaM,KAAM,SAAAR,GACrD,EAAKA,MAAQA,EAAMS,IAAK,SAAAC,GAIvB,OAHCA,EAAiCC,aAAe,EAAAC,KAAKC,OAAOH,EAAKI,MAAMC,UACvEL,EAAiCM,QAAU,EAAKpB,KAAKqB,UAAU,mCAAqC,MAAQP,EAAKQ,aACjH,MAAQ,EAAKtB,KAAKqB,UAAU,mCAAqC,MAAQP,EAAKS,SACxET,CACR,EACD,EACD,EAEA,YAAAU,WAAA,WACCd,KAAKH,QAAQC,SAAU,CACxB,EAEA,YAAAiB,YAAA,WACCf,KAAKH,QAAQC,SAAU,CACxB,EAEA,YAAAkB,WAAA,WACC,OAAOhB,KAAKZ,OAAO6B,cAAejB,KAAKJ,WACxC,EACD,EAjCA,GAoCA,0BACI,KAAAsB,SAAW,IACd,KAAAC,SAAW,UACX,KAAAC,WAAa,CAACC,GACd,KAAAC,aAAe,OACZ,KAAAC,QAAU,CAAC,qBA6Bf,QA3BI,YAAAC,KAAA,SAAKC,EAAoBC,EAAaC,EAAmBC,GACrD,IAAMC,EAAuBD,EAAcA,EAAY,GAAmB,KAC1EC,IAGNJ,EAAMK,WAAa,SAACC,EAASC,G,aAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,MACRF,GAAsB,SAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,OAERJ,GAAsB,UAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,SADzBF,EAAQ,IAAIG,YAAa,EAAAC,wBAAwBC,UAAWP,IAIzDE,GAASH,EAAES,eACdT,EAAES,cAAcC,cAAcP,EAEhC,EAEAL,EAAKzC,OAAOsD,gBAAgBxC,KAAM,SAAAyC,GACjCd,EAAKjC,WAAa+C,EAClBd,EAAK9B,OAAOG,KAAM,WACjBuB,EAAMmB,QACP,EACD,GACD,EACD,EAlCA,IA8CA,IAAAC,SAAQC,cAAcC,QAAQ7C,KAAM,SAAAZ,IAEzB,IAAAC,QAAOC,SAASC,MAAMuD,QAAS,EAAQ,KAElD,GAIa,EAAAC,cAAgB,2BAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,qBAd9C,WACC,OAAO,IAAIC,CACZ,E","sources":["webpack://ode-ngjs-front/./src/ts/widgets/last-infos-widget/last-infos-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/last-infos-widget/last-infos-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \" <div class=\\\"widget-news\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"> <a class=\\\"seemore\\\" href=\\\"/actualites\\\" i18n-title=\\\"last-infos-widget.widget.see.all\\\" dnd-nodrag ng-click=\\\"trackEvent($event, { detail:{'open':'app'} })\\\"> <i18n>last-infos-widget.widget.title</i18n> <span class=\\\"seemore-text\\\"><i18n>last-infos-widget.widget.see.more</i18n></span> </a> </div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\" title=\\\"Déplacer le widget\\\"><i class=\\\"fas fa-grip-vertical\\\" aria-hidden=\\\"true\\\"></i></div> </div> </div> <div class=\\\"widget-body\\\" dnd-nodrag> <div class=\\\"widget-empty-message\\\" ng-if=\\\"ctrl.infos === undefined || ctrl.infos.length === 0\\\"> <i18n>last-infos-widget.widget.empty</i18n> </div> <a class=\\\"news-row\\\" ng-repeat=\\\"info in ctrl.infos track by info._id\\\" ng-href=\\\"/actualites#/view/thread/[[info.thread_id]]/info/[[info._id]]\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'info'} })\\\"> <div class=\\\"news-row-image\\\"> <img ng-if=\\\"!info.thread_icon\\\" skin-src=\\\"/img/illustrations/news.svg\\\" alt=\\\"[[info.thread_title]]\\\" width=\\\"40\\\" height=\\\"40\\\"/> <img ng-if=\\\"info.thread_icon\\\" ng-src=\\\"[[info.thread_icon]]?thumbnail=120x120\\\" alt=\\\"[[info.thread_title]]\\\" width=\\\"40\\\" height=\\\"40\\\"/> </div> <div class=\\\"news-row-text\\\"> <span class=\\\"link d-block\\\">[[info.title]]</span> <span class=\\\"meta\\\">[[info.relativeDate]] - [[info.username]]</span> </div> </a> </div> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective } from \"angular\";\nimport { L10n, conf, notif, TrackedAction, TrackedScope, TrackedActionFromWidget } from \"../../utils\";\nimport { ILastInfosModel, LastInfosWidget } from \"ode-ts-client\";\n\ninterface IExtendedLastInfosModel extends ILastInfosModel {\n\trelativeDate: string;\n\ttooltip: string;\n}\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tpublic widget = new LastInfosWidget();\n\tprivate lang = conf().Platform.idiom;\n\n\tpublic infos:IExtendedLastInfosModel[] = [];\n\tpublic resultSizeValues = [1,2,3,4,5,6,7,8,9,10];\n\tpublic resultSize = 4;\n\tpublic display = {\n\t\tedition: false\n\t};\n\n\tload():Promise<void> {\n\t\treturn this.widget.loadInfos( this.resultSize ).then( infos => {\n\t\t\tthis.infos = infos.map( info => {\n\t\t\t\t(info as IExtendedLastInfosModel).relativeDate = L10n.moment(info.date).fromNow();\n\t\t\t\t(info as IExtendedLastInfosModel).tooltip = this.lang.translate('last-infos-widget.widget.thread') + ' : ' + info.thread_title +\n\t\t\t\t\t' | ' + this.lang.translate('last-infos-widget.widget.author') + ' : ' + info.username;\n\t\t\t\treturn info as IExtendedLastInfosModel;\n\t\t\t});\n\t\t});\n\t};\n\t\n\topenConfig(){\n\t\tthis.display.edition = true;\n\t};\n\t\n\tcloseConfig(){\n\t\tthis.display.edition = false;\n\t};\n\t\n\tsaveConfig(){\n\t\treturn this.widget.setMaxResults( this.resultSize );\n\t};\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./last-infos-widget.widget.html').default;\n\tcontroller = [Controller];\n\tcontrollerAs = 'ctrl';\n require = ['odeLastInfosWidget'];\n\n link(scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]): void {\n const ctrl:Controller|null = controllers ? controllers[0] as Controller : null;\n\t\tif( ! ctrl ) return;\n\n\t\t// Give an opportunity to track some events from outside of this widget.\n\t\tscope.trackEvent = (e:Event, p:CustomEventInit<TrackedAction>) => {\n\t\t\t// Allow events to bubble up.\n\t\t\tif(typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n\t\t\tlet event = null;\n\t\t\tif( p && p.detail?.open==='app' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.lastInfos, p );\n\t\t\t} else if( p && p.detail?.open==='info' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.lastInfos, p );\n\t\t\t}\n\t\t\tif( event && e.currentTarget ) {\n\t\t\t\te.currentTarget.dispatchEvent(event);\n\t\t\t}\n\t\t}\n\n\t\tctrl.widget.getMaxResults().then( num => {\n\t\t\tctrl.resultSize = num;\n\t\t\tctrl.load().then( () => {\n\t\t\t\tscope.$apply();\n\t\t\t});\n\t\t});\n\t}\n}\n\n/** The last-infos widget.\n *\n * Usage:\n * &lt;ode-last-infos></ode-last-infos&gt;\n */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then( lang => {\n\tswitch( lang ) {\n\t\tdefault:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n\t}\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeLastInfosWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeLastInfosWidget\", DirectiveFactory );\n"],"names":["widget","LastInfosWidget","lang","conf","Platform","idiom","infos","resultSizeValues","resultSize","display","edition","load","this","loadInfos","then","map","info","relativeDate","L10n","moment","date","fromNow","tooltip","translate","thread_title","username","openConfig","closeConfig","saveConfig","setMaxResults","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","trackEvent","e","p","bubbles","event","detail","open","CustomEvent","TrackedActionFromWidget","lastInfos","currentTarget","dispatchEvent","getMaxResults","num","$apply","notif","onLangReady","promise","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[536],{5541:(t,e,o)=>{o.d(e,{Z:()=>i});const i='<div class="widget-maxicours"> <div class="widget-header"> <div class="subtitle"><i18n>maxicours-widget.widget.title</i18n></div> <div class="widget-options"> <div class="widget-handle"><i class="fas fa-grip-vertical"></i></div> </div> </div> <div class="widget-body m-3" ng-if="!ctrl.showWidget()" dnd-nodrag> <p> <a data-maxicours-href href="[[ctrl.controllerData.connectorEndpoint]]" target="_blank" rel="noopener" i18n-title="maxicours-widget"> <i class="ic-maxicours"></i> </a> </p> </div> <div class="widget-body p-4" ng-if="ctrl.showWidget()" dnd-nodrag> <i class="ic-maxicours" ng-if="ctrl.controllerData.id < 0"></i> <p ng-if="ctrl.controllerData.id >= 0"> <a data-maxicours-href href="[[ctrl.controllerData.connectorEndpoint]]" target="_blank" rel="noopener" i18n-title="maxicours-widget" ng-if="ctrl.controllerData.id >= 0"> <i class="ic-maxicours"></i> </a> </p> <div ng-if="ctrl.loads"> <div class="widget-empty-message" translate content="loading"></div> </div> <div class="widget-empty-message" ng-if="!ctrl.loads && (!ctrl.controllerData.id || ctrl.controllerData.id < 0)"> <i18n>maxicours-widget.widget.inactive.user</i18n> <form class="mt-3" data-maxicours-action method="get"> <button class="btn btn-primary" ng-click="ctrl.initAuthProcess()" formtarget="_blank" rel="noopener" translate content="maxicours-widget.widget.connect"></button> </form> </div> <div ng-if="!ctrl.loads && ctrl.controllerData.id >= 0"> <div> <i18n>maxicours-widget.widget.my.points</i18n> : <span>[[ ctrl.controllerData.userInfo.activityScore ]]</span> </div> <div> <div ng-if="ctrl.controllerData.userInfo.hasSessionOfTheDay" class="mt-4"> <h4><a ng-href="[[ctrl.controllerData.userInfo.sessionOfTheDayUrl]]" target="_blank" rel="noopener"><i18n>maxicours-widget.widget.daily.session</i18n></a></h4> <ul ng-if="ctrl.controllerData.userInfo.hasSessionOfTheDay === \'true\'"> <li class="activity row border-top py-3 mx-1 align-items-center" ng-repeat="activity in ctrl.controllerData.userInfo.sessionOfTheDayActivities"> <div class="col-auto"> <img class="picto" ng-src="[[activity.picto]]"> </div> <div class="col-auto"> <strong>[[activity.title]]</strong> <p class="mb-0">[[activity.label]]</p> </div> </li> </ul> </div> <div ng-if="ctrl.controllerData.userInfo.newPersonnalCourses.length > 0"> <h4><i18n>maxicours-widget.widget.my.courses<i18n></i18n></i18n></h4> <ul> <li ng-repeat="course in ctrl.controllerData.userInfo.newPersonnalCourses"> <b> <a ng-href="[[course.url]]" target="_blank" rel="noopener">[[course.label]] ([[course.date]])</a> </b> </li> <li ng-repeat="course in ctrl.controllerData.userInfo.currentPersonnalCourses"> <a ng-href="[[course.url]]" target="_blank" rel="noopener">[[course.label]] ([[course.date]])</a> </li> </ul> </div> </div> </div> </div> </div>'},3132:function(t,e,o){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.odeModuleName=void 0;var r=i(o(4202)),n=o(9419),a=i(o(3336)),s=function(){function t(){this.controllerData={},this.loads=!1}return Object.defineProperty(t.prototype,"version",{get:function(){return(0,n.conf)().Platform.deploymentTag},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"me",{get:function(){return(0,n.session)().user},enumerable:!1,configurable:!0}),t.prototype.showWidget=function(){return"ELEVE"===this.me.type},t.prototype.loading=function(t){this.loads=t,this.apply&&this.apply()},t.prototype.authProcess=function(t){var e=this;this.getUserStatus().then((function(){return e.getUserInfo(t)}))},t.prototype.initAuthProcess=function(){var t=this,e=5;this.loading(!0);var o=function(){t.controllerData.id<0&&e-- >0?(t.authProcess(),setTimeout(o,2e3)):t.loading(!1)};setTimeout(o,2e3)},t.prototype.getConf=function(){var t=this;return(0,n.http)().get("/maxicours/conf",{queryParams:{_:this.version}}).then((function(e){if(200!==(0,n.http)().latestResponse.status)throw"Cannot get maxicours widget configuration.";Object.assign(t.controllerData,e),t.controllerData.connectorEndpoint&&((0,a.default)("[data-maxicours-action]").attr("action",t.controllerData.connectorEndpoint),(0,a.default)("[data-maxicours-href]").attr("href",t.controllerData.connectorEndpoint))})).catch((function(){console.log("HTTP error on /maxicours/conf. aide-aux-devoirs widget will not load.")}))},t.prototype.getUserStatus=function(){var t=this;return(0,n.http)().get("/maxicours/getUserStatus",{queryParams:{_:this.version}}).then((function(e){if(200!==(0,n.http)().latestResponse.status)throw"Cannot get maxicours user status.";var o=a.default.parseXML(e),i=(0,a.default)(o);t.controllerData.id=i.find("mxcId").text(),t.apply&&t.apply()})).catch((function(){console.log("HTTP error on /maxicours/getUserStatus. aide-aux-devoirs widget will not load.")}))},t.prototype.getUserInfo=function(t){var e=this;if(void 0===this.controllerData.id||"string"==typeof this.controllerData.id&&0===this.controllerData.id.trim().length||this.controllerData.id<0)return"function"==typeof t&&t(),Promise.resolve();(0,n.http)().get("/maxicours/getUserInfo/"+this.controllerData.id).then((function(t){if(200!==(0,n.http)().latestResponse.status)throw"Cannot get maxicours user info.";try{var o=a.default.parseXML(t),i=(0,a.default)(o),r=function(t,e,o){return(o?t.find(o).find(e):t.find(e)).text()},s=function(t){return(0,a.default)(t).children().toArray().map((function(t){for(var e={},o=(0,a.default)(t).children(),i=0;i<o.length;i++)e[o[i].nodeName]=o[i].textContent;return e}))};e.controllerData.userInfo={hasAnActiveAccount:r(i,"hasAnActiveAccount"),activityScore:r(i,"activityScore"),hasSessionOfTheDay:r(i,"hasSessionOfTheDay"),sessionOfTheDayUrl:r(i,"sessionOfTheDayUrl"),sessionOfTheDayActivities:s(i.find("sessionOfTheDayActivities")),hasPersonnalCourses:r(i,"hasPersonnalCourses"),newPersonnalCourses:s(i.find("newPersonnalCourses")),currentPersonnalCourses:s(i.find("currentPersonnalCourses"))},e.apply&&e.apply()}catch(t){console.log("Cannot parse maxicours user info.")}})).finally((function(){"function"==typeof t&&t()}))},t}(),c=function(){function t(){this.restrict="E",this.template=o(5541).Z,this.controller=[s],this.controllerAs="ctrl",this.require=["odeMaxicoursWidget"]}return t.prototype.link=function(t,e,o,i){var r=i?i[0]:null;r&&(r.apply=function(){t.$apply()},r.getConf().then((function(){return r.authProcess((function(){r.loading(!1),r.apply&&r.apply()}))})))},t}();(0,n.notif)().onLangReady().promise.then((function(t){(0,n.conf)().Platform.idiom.addKeys(o(841))})),e.odeModuleName="odeMaxicoursWidgetModule",r.default.module(e.odeModuleName,[]).directive("odeMaxicoursWidget",(function(){return new c}))},841:t=>{t.exports=JSON.parse('{"maxicours-widget":"Aide aux devoirs","maxicours-widget.widget.title":"Aide aux devoirs","maxicours-widget.widget.inactive.user":"Vous n\'êtes pas authentifié sur le service.","maxicours-widget.widget.connect":"Activer mon compte","maxicours-widget.widget.refresh":"Rafraîchir les informations","maxicours-widget.widget.my.points":"Mes points","maxicours-widget.widget.points":"pts","maxicours-widget.widget.daily.session":"Ma séance du jour","maxicours-widget.widget.my.courses":"Mes parcours à réaliser"}')}}]);
1
+ "use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[536],{5541:(t,e,o)=>{o.d(e,{Z:()=>i});const i='<div class="widget-maxicours"> <div class="widget-header"> <div class="subtitle"><i18n>maxicours-widget.widget.title</i18n></div> <div class="widget-options"> <div class="widget-handle"><i class="fas fa-grip-vertical"></i></div> </div> </div> <div class="widget-body m-3" ng-if="!ctrl.showWidget()" dnd-nodrag> <p> <a data-maxicours-href href="[[ctrl.controllerData.connectorEndpoint]]" target="_blank" rel="noopener" i18n-title="maxicours-widget"> <i class="ic-maxicours"></i> </a> </p> </div> <div class="widget-body p-4" ng-if="ctrl.showWidget()" dnd-nodrag> <i class="ic-maxicours" ng-if="ctrl.controllerData.id < 0"></i> <p ng-if="ctrl.controllerData.id >= 0"> <a data-maxicours-href href="[[ctrl.controllerData.connectorEndpoint]]" target="_blank" rel="noopener" i18n-title="maxicours-widget" ng-if="ctrl.controllerData.id >= 0"> <i class="ic-maxicours"></i> </a> </p> <div ng-if="ctrl.loads"> <div class="widget-empty-message" translate content="loading"></div> </div> <div class="widget-empty-message" ng-if="!ctrl.loads && (!ctrl.controllerData.id || ctrl.controllerData.id < 0)"> <i18n>maxicours-widget.widget.inactive.user</i18n> <form class="mt-3" data-maxicours-action method="get"> <button class="btn btn-primary" ng-click="ctrl.initAuthProcess()" formtarget="_blank" rel="noopener" translate content="maxicours-widget.widget.connect"></button> </form> </div> <div ng-if="!ctrl.loads && ctrl.controllerData.id >= 0"> <div> <i18n>maxicours-widget.widget.my.points</i18n> : <span>[[ ctrl.controllerData.userInfo.activityScore ]]</span> </div> <div> <div ng-if="ctrl.controllerData.userInfo.hasSessionOfTheDay" class="mt-4"> <h4><a ng-href="[[ctrl.controllerData.userInfo.sessionOfTheDayUrl]]" target="_blank" rel="noopener"><i18n>maxicours-widget.widget.daily.session</i18n></a></h4> <ul ng-if="ctrl.controllerData.userInfo.hasSessionOfTheDay === \'true\'"> <li class="activity row border-top py-3 mx-1 align-items-center" ng-repeat="activity in ctrl.controllerData.userInfo.sessionOfTheDayActivities"> <div class="col-auto"> <img class="picto" ng-src="[[activity.picto]]"> </div> <div class="col-auto"> <strong>[[activity.title]]</strong> <p class="mb-0">[[activity.label]]</p> </div> </li> </ul> </div> <div ng-if="ctrl.controllerData.userInfo.newPersonnalCourses.length > 0"> <h4><i18n>maxicours-widget.widget.my.courses<i18n></i18n></i18n></h4> <ul> <li ng-repeat="course in ctrl.controllerData.userInfo.newPersonnalCourses"> <b> <a ng-href="[[course.url]]" target="_blank" rel="noopener">[[course.label]] ([[course.date]])</a> </b> </li> <li ng-repeat="course in ctrl.controllerData.userInfo.currentPersonnalCourses"> <a ng-href="[[course.url]]" target="_blank" rel="noopener">[[course.label]] ([[course.date]])</a> </li> </ul> </div> </div> </div> </div> </div>'},3132:function(t,e,o){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.odeModuleName=void 0;var r=i(o(4202)),n=o(9419),a=i(o(3336)),s=function(){function t(){this.controllerData={},this.loads=!1}return Object.defineProperty(t.prototype,"version",{get:function(){return(0,n.conf)().Platform.deploymentTag},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"me",{get:function(){return(0,n.session)().user},enumerable:!1,configurable:!0}),t.prototype.showWidget=function(){return"ELEVE"===this.me.type},t.prototype.loading=function(t){this.loads=t,this.apply&&this.apply()},t.prototype.authProcess=function(t){var e=this;this.getUserStatus().then(function(){return e.getUserInfo(t)})},t.prototype.initAuthProcess=function(){var t=this,e=5;this.loading(!0);var o=function(){t.controllerData.id<0&&e-- >0?(t.authProcess(),setTimeout(o,2e3)):t.loading(!1)};setTimeout(o,2e3)},t.prototype.getConf=function(){var t=this;return(0,n.http)().get("/maxicours/conf",{queryParams:{_:this.version}}).then(function(e){if(200!==(0,n.http)().latestResponse.status)throw"Cannot get maxicours widget configuration.";Object.assign(t.controllerData,e),t.controllerData.connectorEndpoint&&((0,a.default)("[data-maxicours-action]").attr("action",t.controllerData.connectorEndpoint),(0,a.default)("[data-maxicours-href]").attr("href",t.controllerData.connectorEndpoint))}).catch(function(){console.log("HTTP error on /maxicours/conf. aide-aux-devoirs widget will not load.")})},t.prototype.getUserStatus=function(){var t=this;return(0,n.http)().get("/maxicours/getUserStatus",{queryParams:{_:this.version}}).then(function(e){if(200!==(0,n.http)().latestResponse.status)throw"Cannot get maxicours user status.";var o=a.default.parseXML(e),i=(0,a.default)(o);t.controllerData.id=i.find("mxcId").text(),t.apply&&t.apply()}).catch(function(){console.log("HTTP error on /maxicours/getUserStatus. aide-aux-devoirs widget will not load.")})},t.prototype.getUserInfo=function(t){var e=this;if(void 0===this.controllerData.id||"string"==typeof this.controllerData.id&&0===this.controllerData.id.trim().length||this.controllerData.id<0)return"function"==typeof t&&t(),Promise.resolve();(0,n.http)().get("/maxicours/getUserInfo/"+this.controllerData.id).then(function(t){if(200!==(0,n.http)().latestResponse.status)throw"Cannot get maxicours user info.";try{var o=a.default.parseXML(t),i=(0,a.default)(o),r=function(t,e,o){return(o?t.find(o).find(e):t.find(e)).text()},s=function(t){return(0,a.default)(t).children().toArray().map(function(t){for(var e={},o=(0,a.default)(t).children(),i=0;i<o.length;i++)e[o[i].nodeName]=o[i].textContent;return e})};e.controllerData.userInfo={hasAnActiveAccount:r(i,"hasAnActiveAccount"),activityScore:r(i,"activityScore"),hasSessionOfTheDay:r(i,"hasSessionOfTheDay"),sessionOfTheDayUrl:r(i,"sessionOfTheDayUrl"),sessionOfTheDayActivities:s(i.find("sessionOfTheDayActivities")),hasPersonnalCourses:r(i,"hasPersonnalCourses"),newPersonnalCourses:s(i.find("newPersonnalCourses")),currentPersonnalCourses:s(i.find("currentPersonnalCourses"))},e.apply&&e.apply()}catch(t){console.log("Cannot parse maxicours user info.")}}).finally(function(){"function"==typeof t&&t()})},t}(),c=function(){function t(){this.restrict="E",this.template=o(5541).Z,this.controller=[s],this.controllerAs="ctrl",this.require=["odeMaxicoursWidget"]}return t.prototype.link=function(t,e,o,i){var r=i?i[0]:null;r&&(r.apply=function(){t.$apply()},r.getConf().then(function(){return r.authProcess(function(){r.loading(!1),r.apply&&r.apply()})}))},t}();(0,n.notif)().onLangReady().promise.then(function(t){(0,n.conf)().Platform.idiom.addKeys(o(841))}),e.odeModuleName="odeMaxicoursWidgetModule",r.default.module(e.odeModuleName,[]).directive("odeMaxicoursWidget",function(){return new c})},841:t=>{t.exports=JSON.parse('{"maxicours-widget":"Aide aux devoirs","maxicours-widget.widget.connect":"Activer mon compte","maxicours-widget.widget.daily.session":"Ma séance du jour","maxicours-widget.widget.inactive.user":"Vous n\'êtes pas authentifié sur le service.","maxicours-widget.widget.my.courses":"Mes parcours à réaliser","maxicours-widget.widget.my.points":"Mes points","maxicours-widget.widget.points":"pts","maxicours-widget.widget.refresh":"Rafraîchir les informations","maxicours-widget.widget.title":"Aide aux devoirs"}')}}]);
2
2
  //# sourceMappingURL=maxicours-widget.widget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"widgets/maxicours-widget/maxicours-widget.widget.js","mappings":"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","sources":["webpack://ode-ngjs-front/./src/ts/widgets/maxicours-widget/maxicours-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/maxicours-widget/maxicours-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<div class=\\\"widget-maxicours\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"><i18n>maxicours-widget.widget.title</i18n></div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\"><i class=\\\"fas fa-grip-vertical\\\"></i></div> </div> </div> <div class=\\\"widget-body m-3\\\" ng-if=\\\"!ctrl.showWidget()\\\" dnd-nodrag> <p> <a data-maxicours-href href=\\\"[[ctrl.controllerData.connectorEndpoint]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" i18n-title=\\\"maxicours-widget\\\"> <i class=\\\"ic-maxicours\\\"></i> </a> </p> </div> <div class=\\\"widget-body p-4\\\" ng-if=\\\"ctrl.showWidget()\\\" dnd-nodrag> <i class=\\\"ic-maxicours\\\" ng-if=\\\"ctrl.controllerData.id < 0\\\"></i> <p ng-if=\\\"ctrl.controllerData.id >= 0\\\"> <a data-maxicours-href href=\\\"[[ctrl.controllerData.connectorEndpoint]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" i18n-title=\\\"maxicours-widget\\\" ng-if=\\\"ctrl.controllerData.id >= 0\\\"> <i class=\\\"ic-maxicours\\\"></i> </a> </p> <div ng-if=\\\"ctrl.loads\\\"> <div class=\\\"widget-empty-message\\\" translate content=\\\"loading\\\"></div> </div> <div class=\\\"widget-empty-message\\\" ng-if=\\\"!ctrl.loads && (!ctrl.controllerData.id || ctrl.controllerData.id < 0)\\\"> <i18n>maxicours-widget.widget.inactive.user</i18n> <form class=\\\"mt-3\\\" data-maxicours-action method=\\\"get\\\"> <button class=\\\"btn btn-primary\\\" ng-click=\\\"ctrl.initAuthProcess()\\\" formtarget=\\\"_blank\\\" rel=\\\"noopener\\\" translate content=\\\"maxicours-widget.widget.connect\\\"></button> </form> </div> <div ng-if=\\\"!ctrl.loads && ctrl.controllerData.id >= 0\\\"> <div> <i18n>maxicours-widget.widget.my.points</i18n> : <span>[[ ctrl.controllerData.userInfo.activityScore ]]</span> </div> <div> <div ng-if=\\\"ctrl.controllerData.userInfo.hasSessionOfTheDay\\\" class=\\\"mt-4\\\"> <h4><a ng-href=\\\"[[ctrl.controllerData.userInfo.sessionOfTheDayUrl]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\"><i18n>maxicours-widget.widget.daily.session</i18n></a></h4> <ul ng-if=\\\"ctrl.controllerData.userInfo.hasSessionOfTheDay === 'true'\\\"> <li class=\\\"activity row border-top py-3 mx-1 align-items-center\\\" ng-repeat=\\\"activity in ctrl.controllerData.userInfo.sessionOfTheDayActivities\\\"> <div class=\\\"col-auto\\\"> <img class=\\\"picto\\\" ng-src=\\\"[[activity.picto]]\\\"> </div> <div class=\\\"col-auto\\\"> <strong>[[activity.title]]</strong> <p class=\\\"mb-0\\\">[[activity.label]]</p> </div> </li> </ul> </div> <div ng-if=\\\"ctrl.controllerData.userInfo.newPersonnalCourses.length > 0\\\"> <h4><i18n>maxicours-widget.widget.my.courses<i18n></i18n></i18n></h4> <ul> <li ng-repeat=\\\"course in ctrl.controllerData.userInfo.newPersonnalCourses\\\"> <b> <a ng-href=\\\"[[course.url]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\">[[course.label]] ([[course.date]])</a> </b> </li> <li ng-repeat=\\\"course in ctrl.controllerData.userInfo.currentPersonnalCourses\\\"> <a ng-href=\\\"[[course.url]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\">[[course.label]] ([[course.date]])</a> </li> </ul> </div> </div> </div> </div> </div>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { IUserInfo } from \"ode-ts-client\";\nimport { conf, notif, session, http } from \"../../utils\";\nimport $ from \"jquery\"; // FIXME : remove jQuery dependency \n\n/* Controller for the directive */\nclass Controller implements IController {\n // Shortcut for refreshing the view.\n public apply?: () => void;\n controllerData:{\n id?:any;\n connectorEndpoint?:string;\n userInfo?:{\n hasAnActiveAccount: string;\n activityScore: string;\n hasSessionOfTheDay: string;\n sessionOfTheDayUrl: string;\n sessionOfTheDayActivities: Array<any|string>;\n hasPersonnalCourses: string;\n newPersonnalCourses: Array<any|string>;\n currentPersonnalCourses: Array<any|string>;\n };\n } = {};\n loads:boolean = false;\n\n private get version(): string {\n return conf().Platform.deploymentTag;\n }\n private get me(): IUserInfo {\n return session().user;\n }\n\n showWidget() {\n return this.me.type === 'ELEVE';\n }\n\n loading(mode:boolean) {\n this.loads = mode;\n this.apply && this.apply();\n }\n\n authProcess(hook?: any) {\n this.getUserStatus().then( () => this.getUserInfo(hook) );\n }\n\n initAuthProcess() {\n const delay = 2000;\n let countdown = 5;\n this.loading(true);\n const timeoutFunction = () => {\n if (this.controllerData.id < 0 && countdown-- > 0) {\n this.authProcess();\n setTimeout(timeoutFunction, delay);\n } else {\n this.loading(false);\n }\n }\n setTimeout(timeoutFunction, delay);\n }\n\n getConf() {\n return http().get('/maxicours/conf', { queryParams: { \"_\": this.version } })\n .then( data => {\n if( http().latestResponse.status !== 200 ) {\n throw \"Cannot get maxicours widget configuration.\";\n }\n Object.assign( this.controllerData, data );\n if( this.controllerData.connectorEndpoint ) {\n $(\"[data-maxicours-action]\").attr(\"action\", this.controllerData.connectorEndpoint );\n $(\"[data-maxicours-href]\").attr(\"href\", this.controllerData.connectorEndpoint );\n }\n })\n .catch( () => {\n console.log('HTTP error on /maxicours/conf. aide-aux-devoirs widget will not load.');\n });\n }\n\n getUserStatus() {\n return http().get<string>('/maxicours/getUserStatus', { queryParams: { \"_\": this.version } })\n .then( xml => {\n if( http().latestResponse.status !== 200 ) {\n throw \"Cannot get maxicours user status.\";\n }\n const xmlDocument = $.parseXML(xml);\n const $xml = $(xmlDocument);\n\n this.controllerData.id = $xml.find(\"mxcId\").text()\n this.apply && this.apply();\n })\n .catch( () => {\n console.log('HTTP error on /maxicours/getUserStatus. aide-aux-devoirs widget will not load.');\n });\n }\n\n getUserInfo(hook?:any) {\n if (typeof this.controllerData.id === \"undefined\"\n || (typeof this.controllerData.id === \"string\" && this.controllerData.id.trim().length === 0)\n || this.controllerData.id < 0) {\n if (typeof hook === 'function')\n hook();\n return Promise.resolve();\n }\n\n http().get<string>('/maxicours/getUserInfo/' + this.controllerData.id)\n .then( xml => {\n if( http().latestResponse.status !== 200 ) {\n throw \"Cannot get maxicours user info.\";\n }\n try {\n const xmlDocument = $.parseXML(xml);\n const $xml = $(xmlDocument);\n\n let getText = function (xml:JQuery<XMLDocument>, tagName:string, parent?:string) {\n const tags = parent ? xml.find(parent).find(tagName) : xml.find(tagName)\n return tags.text()\n }\n let getContent = function (xml:JQuery<XMLDocument>, tagName:string, parent?:string) {\n const tags = parent ? xml.find(parent).find(tagName) : xml.find(tagName)\n return tags.contents()\n }\n let jsonifyArray = function(arrayTag:JQuery<HTMLElement>) {\n return $(arrayTag).children().toArray().map( item => {\n let serialized:any = {};\n const children = $(item).children();\n for (let i = 0; i < children.length; i++) {\n serialized[children[i].nodeName] = children[i].textContent;\n }\n return serialized;\n });\n }\n\n this.controllerData.userInfo = {\n hasAnActiveAccount: getText($xml, \"hasAnActiveAccount\"),\n activityScore: getText($xml, \"activityScore\"),\n hasSessionOfTheDay: getText($xml, \"hasSessionOfTheDay\"),\n sessionOfTheDayUrl: getText($xml, \"sessionOfTheDayUrl\"),\n sessionOfTheDayActivities: jsonifyArray($xml.find(\"sessionOfTheDayActivities\")),\n hasPersonnalCourses: getText($xml, \"hasPersonnalCourses\"),\n newPersonnalCourses: jsonifyArray($xml.find(\"newPersonnalCourses\")),\n currentPersonnalCourses: jsonifyArray($xml.find(\"currentPersonnalCourses\"))\n }\n\n this.apply && this.apply();\n } catch (e) {\n console.log(\"Cannot parse maxicours user info.\");\n }\n })\n .finally( () => {\n if (typeof hook === 'function')\n hook();\n });\n }\n\n}\n\n/* Directive */\nclass Directive implements IDirective<IScope, JQLite, IAttributes, IController[]> {\n restrict = 'E';\n template = require('./maxicours-widget.widget.html').default;\n controller = [Controller];\n controllerAs = 'ctrl';\n require = ['odeMaxicoursWidget'];\n\n link(scope: IScope, elem: JQLite, attrs: IAttributes, controllers?: IController[]): void {\n const ctrl: Controller | null = controllers ? controllers[0] as Controller : null;\n if (!ctrl) return;\n\n ctrl.apply = () => {\n scope.$apply();\n };\n\n ctrl.getConf()\n .then( () => ctrl.authProcess( () => {\n ctrl.loading( false );\n ctrl.apply && ctrl.apply();\n }));\n }\n}\n\n/** The maxicours-widget widget. */\nfunction DirectiveFactory() {\n return new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then(lang => {\n switch (lang) {\n default: conf().Platform.idiom.addKeys(require('./i18n/fr.json')); break;\n }\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeMaxicoursWidgetModule\";\nangular.module(odeModuleName, []).directive(\"odeMaxicoursWidget\", DirectiveFactory);\n"],"names":["controllerData","loads","conf","Platform","deploymentTag","session","user","showWidget","this","me","type","loading","mode","apply","authProcess","hook","getUserStatus","then","getUserInfo","initAuthProcess","countdown","timeoutFunction","id","setTimeout","getConf","http","get","queryParams","version","data","latestResponse","status","Object","assign","connectorEndpoint","attr","catch","console","log","xml","xmlDocument","parseXML","$xml","find","text","trim","length","Promise","resolve","getText","tagName","parent","jsonifyArray","arrayTag","children","toArray","map","item","serialized","i","nodeName","textContent","userInfo","hasAnActiveAccount","activityScore","hasSessionOfTheDay","sessionOfTheDayUrl","sessionOfTheDayActivities","hasPersonnalCourses","newPersonnalCourses","currentPersonnalCourses","e","finally","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","$apply","notif","onLangReady","promise","lang","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
1
+ {"version":3,"file":"widgets/maxicours-widget/maxicours-widget.widget.js","mappings":"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","sources":["webpack://ode-ngjs-front/./src/ts/widgets/maxicours-widget/maxicours-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/maxicours-widget/maxicours-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<div class=\\\"widget-maxicours\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"><i18n>maxicours-widget.widget.title</i18n></div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\"><i class=\\\"fas fa-grip-vertical\\\"></i></div> </div> </div> <div class=\\\"widget-body m-3\\\" ng-if=\\\"!ctrl.showWidget()\\\" dnd-nodrag> <p> <a data-maxicours-href href=\\\"[[ctrl.controllerData.connectorEndpoint]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" i18n-title=\\\"maxicours-widget\\\"> <i class=\\\"ic-maxicours\\\"></i> </a> </p> </div> <div class=\\\"widget-body p-4\\\" ng-if=\\\"ctrl.showWidget()\\\" dnd-nodrag> <i class=\\\"ic-maxicours\\\" ng-if=\\\"ctrl.controllerData.id < 0\\\"></i> <p ng-if=\\\"ctrl.controllerData.id >= 0\\\"> <a data-maxicours-href href=\\\"[[ctrl.controllerData.connectorEndpoint]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" i18n-title=\\\"maxicours-widget\\\" ng-if=\\\"ctrl.controllerData.id >= 0\\\"> <i class=\\\"ic-maxicours\\\"></i> </a> </p> <div ng-if=\\\"ctrl.loads\\\"> <div class=\\\"widget-empty-message\\\" translate content=\\\"loading\\\"></div> </div> <div class=\\\"widget-empty-message\\\" ng-if=\\\"!ctrl.loads && (!ctrl.controllerData.id || ctrl.controllerData.id < 0)\\\"> <i18n>maxicours-widget.widget.inactive.user</i18n> <form class=\\\"mt-3\\\" data-maxicours-action method=\\\"get\\\"> <button class=\\\"btn btn-primary\\\" ng-click=\\\"ctrl.initAuthProcess()\\\" formtarget=\\\"_blank\\\" rel=\\\"noopener\\\" translate content=\\\"maxicours-widget.widget.connect\\\"></button> </form> </div> <div ng-if=\\\"!ctrl.loads && ctrl.controllerData.id >= 0\\\"> <div> <i18n>maxicours-widget.widget.my.points</i18n> : <span>[[ ctrl.controllerData.userInfo.activityScore ]]</span> </div> <div> <div ng-if=\\\"ctrl.controllerData.userInfo.hasSessionOfTheDay\\\" class=\\\"mt-4\\\"> <h4><a ng-href=\\\"[[ctrl.controllerData.userInfo.sessionOfTheDayUrl]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\"><i18n>maxicours-widget.widget.daily.session</i18n></a></h4> <ul ng-if=\\\"ctrl.controllerData.userInfo.hasSessionOfTheDay === 'true'\\\"> <li class=\\\"activity row border-top py-3 mx-1 align-items-center\\\" ng-repeat=\\\"activity in ctrl.controllerData.userInfo.sessionOfTheDayActivities\\\"> <div class=\\\"col-auto\\\"> <img class=\\\"picto\\\" ng-src=\\\"[[activity.picto]]\\\"> </div> <div class=\\\"col-auto\\\"> <strong>[[activity.title]]</strong> <p class=\\\"mb-0\\\">[[activity.label]]</p> </div> </li> </ul> </div> <div ng-if=\\\"ctrl.controllerData.userInfo.newPersonnalCourses.length > 0\\\"> <h4><i18n>maxicours-widget.widget.my.courses<i18n></i18n></i18n></h4> <ul> <li ng-repeat=\\\"course in ctrl.controllerData.userInfo.newPersonnalCourses\\\"> <b> <a ng-href=\\\"[[course.url]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\">[[course.label]] ([[course.date]])</a> </b> </li> <li ng-repeat=\\\"course in ctrl.controllerData.userInfo.currentPersonnalCourses\\\"> <a ng-href=\\\"[[course.url]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\">[[course.label]] ([[course.date]])</a> </li> </ul> </div> </div> </div> </div> </div>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { IUserInfo } from \"ode-ts-client\";\nimport { conf, notif, session, http } from \"../../utils\";\nimport $ from \"jquery\"; // FIXME : remove jQuery dependency \n\n/* Controller for the directive */\nclass Controller implements IController {\n // Shortcut for refreshing the view.\n public apply?: () => void;\n controllerData:{\n id?:any;\n connectorEndpoint?:string;\n userInfo?:{\n hasAnActiveAccount: string;\n activityScore: string;\n hasSessionOfTheDay: string;\n sessionOfTheDayUrl: string;\n sessionOfTheDayActivities: Array<any|string>;\n hasPersonnalCourses: string;\n newPersonnalCourses: Array<any|string>;\n currentPersonnalCourses: Array<any|string>;\n };\n } = {};\n loads:boolean = false;\n\n private get version(): string {\n return conf().Platform.deploymentTag;\n }\n private get me(): IUserInfo {\n return session().user;\n }\n\n showWidget() {\n return this.me.type === 'ELEVE';\n }\n\n loading(mode:boolean) {\n this.loads = mode;\n this.apply && this.apply();\n }\n\n authProcess(hook?: any) {\n this.getUserStatus().then( () => this.getUserInfo(hook) );\n }\n\n initAuthProcess() {\n const delay = 2000;\n let countdown = 5;\n this.loading(true);\n const timeoutFunction = () => {\n if (this.controllerData.id < 0 && countdown-- > 0) {\n this.authProcess();\n setTimeout(timeoutFunction, delay);\n } else {\n this.loading(false);\n }\n }\n setTimeout(timeoutFunction, delay);\n }\n\n getConf() {\n return http().get('/maxicours/conf', { queryParams: { \"_\": this.version } })\n .then( data => {\n if( http().latestResponse.status !== 200 ) {\n throw \"Cannot get maxicours widget configuration.\";\n }\n Object.assign( this.controllerData, data );\n if( this.controllerData.connectorEndpoint ) {\n $(\"[data-maxicours-action]\").attr(\"action\", this.controllerData.connectorEndpoint );\n $(\"[data-maxicours-href]\").attr(\"href\", this.controllerData.connectorEndpoint );\n }\n })\n .catch( () => {\n console.log('HTTP error on /maxicours/conf. aide-aux-devoirs widget will not load.');\n });\n }\n\n getUserStatus() {\n return http().get<string>('/maxicours/getUserStatus', { queryParams: { \"_\": this.version } })\n .then( xml => {\n if( http().latestResponse.status !== 200 ) {\n throw \"Cannot get maxicours user status.\";\n }\n const xmlDocument = $.parseXML(xml);\n const $xml = $(xmlDocument);\n\n this.controllerData.id = $xml.find(\"mxcId\").text()\n this.apply && this.apply();\n })\n .catch( () => {\n console.log('HTTP error on /maxicours/getUserStatus. aide-aux-devoirs widget will not load.');\n });\n }\n\n getUserInfo(hook?:any) {\n if (typeof this.controllerData.id === \"undefined\"\n || (typeof this.controllerData.id === \"string\" && this.controllerData.id.trim().length === 0)\n || this.controllerData.id < 0) {\n if (typeof hook === 'function')\n hook();\n return Promise.resolve();\n }\n\n http().get<string>('/maxicours/getUserInfo/' + this.controllerData.id)\n .then( xml => {\n if( http().latestResponse.status !== 200 ) {\n throw \"Cannot get maxicours user info.\";\n }\n try {\n const xmlDocument = $.parseXML(xml);\n const $xml = $(xmlDocument);\n\n let getText = function (xml:JQuery<XMLDocument>, tagName:string, parent?:string) {\n const tags = parent ? xml.find(parent).find(tagName) : xml.find(tagName)\n return tags.text()\n }\n let getContent = function (xml:JQuery<XMLDocument>, tagName:string, parent?:string) {\n const tags = parent ? xml.find(parent).find(tagName) : xml.find(tagName)\n return tags.contents()\n }\n let jsonifyArray = function(arrayTag:JQuery<HTMLElement>) {\n return $(arrayTag).children().toArray().map( item => {\n let serialized:any = {};\n const children = $(item).children();\n for (let i = 0; i < children.length; i++) {\n serialized[children[i].nodeName] = children[i].textContent;\n }\n return serialized;\n });\n }\n\n this.controllerData.userInfo = {\n hasAnActiveAccount: getText($xml, \"hasAnActiveAccount\"),\n activityScore: getText($xml, \"activityScore\"),\n hasSessionOfTheDay: getText($xml, \"hasSessionOfTheDay\"),\n sessionOfTheDayUrl: getText($xml, \"sessionOfTheDayUrl\"),\n sessionOfTheDayActivities: jsonifyArray($xml.find(\"sessionOfTheDayActivities\")),\n hasPersonnalCourses: getText($xml, \"hasPersonnalCourses\"),\n newPersonnalCourses: jsonifyArray($xml.find(\"newPersonnalCourses\")),\n currentPersonnalCourses: jsonifyArray($xml.find(\"currentPersonnalCourses\"))\n }\n\n this.apply && this.apply();\n } catch (e) {\n console.log(\"Cannot parse maxicours user info.\");\n }\n })\n .finally( () => {\n if (typeof hook === 'function')\n hook();\n });\n }\n\n}\n\n/* Directive */\nclass Directive implements IDirective<IScope, JQLite, IAttributes, IController[]> {\n restrict = 'E';\n template = require('./maxicours-widget.widget.html').default;\n controller = [Controller];\n controllerAs = 'ctrl';\n require = ['odeMaxicoursWidget'];\n\n link(scope: IScope, elem: JQLite, attrs: IAttributes, controllers?: IController[]): void {\n const ctrl: Controller | null = controllers ? controllers[0] as Controller : null;\n if (!ctrl) return;\n\n ctrl.apply = () => {\n scope.$apply();\n };\n\n ctrl.getConf()\n .then( () => ctrl.authProcess( () => {\n ctrl.loading( false );\n ctrl.apply && ctrl.apply();\n }));\n }\n}\n\n/** The maxicours-widget widget. */\nfunction DirectiveFactory() {\n return new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then(lang => {\n switch (lang) {\n default: conf().Platform.idiom.addKeys(require('./i18n/fr.json')); break;\n }\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeMaxicoursWidgetModule\";\nangular.module(odeModuleName, []).directive(\"odeMaxicoursWidget\", DirectiveFactory);\n"],"names":["controllerData","loads","conf","Platform","deploymentTag","session","user","showWidget","this","me","type","loading","mode","apply","authProcess","hook","getUserStatus","then","getUserInfo","initAuthProcess","countdown","timeoutFunction","id","setTimeout","getConf","http","get","queryParams","version","data","latestResponse","status","Object","assign","connectorEndpoint","attr","catch","console","log","xml","xmlDocument","parseXML","$xml","find","text","trim","length","Promise","resolve","getText","tagName","parent","jsonifyArray","arrayTag","children","toArray","map","item","serialized","i","nodeName","textContent","userInfo","hasAnActiveAccount","activityScore","hasSessionOfTheDay","sessionOfTheDayUrl","sessionOfTheDayActivities","hasPersonnalCourses","newPersonnalCourses","currentPersonnalCourses","e","finally","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","$apply","notif","onLangReady","promise","lang","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[820],{1058:(e,t,i)=>{i.d(t,{Z:()=>n});const n='<style>.widget-mediacentre .widget-body{max-height:300px;overflow:auto}.widget-mediacentre .widget-body .empty{display:flex;align-items:center;justify-content:center;padding:8px;font-style:italic}.widget-mediacentre .widget-body .resource-list{display:flex;flex-wrap:wrap}.widget-mediacentre .widget-body .resource-list-item{position:relative;width:25%;height:150px}.widget-mediacentre .widget-body .resource-list-item a{display:flex;flex-direction:column;align-items:center;justify-content:center;transition:background-color .8s cubic-bezier(.25,.46,.45,.94);position:relative;margin:1px;padding:0 8px;color:unset;text-decoration:none;background:#fafafa;height:99%;width:auto}.widget-mediacentre .widget-body .resource-list-item a:hover{background-color:#fff;color:#ff8d2e;cursor:pointer}.widget-mediacentre .widget-body .resource-list-item .picture{height:80%;display:flex;align-items:center;justify-content:center}.widget-mediacentre .widget-body .resource-list-item .picture img{max-height:100%;max-width:100%}.widget-mediacentre .widget-body .resource-list-item .title{height:20%;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.widget-mediacentre #universalis-container .widget-body{padding:10px 0}.widget-mediacentre #universalis-container .widget-empty-message{display:flex;align-items:center;justify-content:space-between;padding:12px}.widget-mediacentre #universalis-container .widget-empty-message:first-child,.widget-mediacentre #universalis-container form{max-height:40px}.widget-mediacentre #universalis-container .widget-empty-message form *,.widget-mediacentre #universalis-container .widget-empty-message:first-child *{max-height:inherit}.widget-mediacentre #universalis-container img{width:auto}.widget-mediacentre #universalis-container form{width:90%}.widget-mediacentre #universalis-container form .input-group input#inputUniversalisQ{height:30px}.widget-mediacentre #universalis-container form .input-group button{padding:0 8px}</style> <div class="widget-mediacentre"> <div class="widget-header"> <div class="subtitle"> <a class="seemore" href="/mediacentre" i18n-title="mediacentre.widget.more" dnd-nodrag ng-click="trackEvent($event, {detail:{\'open\':\'more\'} })"> <i18n>mediacentre.widget.title</i18n> <span class="seemore-text"><i18n>mediacentre.widget.more</i18n></span> </a> </div> <div class="widget-options"> <div class="widget-handle" title="Déplacer le widget"><i class="fas fa-grip-vertical" aria-hidden="true"></i></div> </div> </div> <div class="widget-body" dnd-nodrag> <ul class="resource-list" ng-if="ctrl.resources.length > 0"> <li class="resource-list-item" ng-repeat="resource in ctrl.resources" title="[[resource.title]]"> <a ng-href="[[resource.link]]" target="_blank"> <div class="picture"><img skin-src="[[resource.image]]" alt="[[resource.title]]"/></div> <div class="title">[[resource.title]]</div> </a> </li> </ul> <div class="empty" ng-if="ctrl.resources.length <= 0"> <i18n>mediacentre.widget.empty</i18n> </div> </div> <div class="widget-footer border-top border-ghost" ng-if="ctrl.hasUniversalis"> <div id="universalis-container"> <div class="widget-body"> <div class="widget-empty-message"> <div class="row row-cols-1 align-items-center"> <div class="mb-3"> <a href="http://www.universalis-edu.com" target="_blank" rel="noopener" ng-click="trackEvent($event, {detail:{\'open\':\'universalis\'} })"> <img src="/assets/widgets/mediacentre-widget/universalis.png" width="75" alt="Universalis"> </a> </div> </div> <form method="GET" action="https://www.universalis-edu.com/nomade/precherche/" target="_blank" autocomplete="off"> <div class="row row-cols-1 align-items-center"> <label class="sr-only" for="inputUniversalisQ" translate content="{{ctrl.selectedSchool.UAI == null ? \'mediacentre.widget.universalis.no.uai\' : \'mediacentre.widget.universalis.search\'}}"></label> <div class="input-group mb-2"> <input type="text" id="inputUniversalisQ" class="form-control" name="q" maxlen gth="255" i18n-placeholder="{{ctrl.selectedSchool.UAI == null ? \'mediacentre.widget.universalis.no.uai\' : \'mediacentre.widget.universalis.search\'}}" ng-disabled="ctrl.selectedSchool.UAI == null"/> <input type="hidden" name="r" value="www"/> <input type="hidden" name="uai" value="{{ctrl.selectedSchool.UAI}}"/> <button class="btn btn-outline-secondary" ng-class="{\'disabled\': ctrl.selectedSchool.UAI == null}" aria-labelledby="inputUniversalisQ" ng-click="trackEvent($event, {detail:{\'search\':\'launch\'} })"> <i class="ic-search"></i> </button> </div> </div> </form> </div> </div> </div> </div> </div>'},5116:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.odeModuleName=void 0;var o=s(i(4202)),a=i(9419),c=i(5262),l=function(){function e(){var e=this;this.resources=[],this.limitResources=4,this.hasUniversalis=!1,this.initResources=function(){return n(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.initResourcesFavorites()];case 1:return e.sent(),[4,this.initSignetFavorites()];case 2:return e.sent(),[4,this.hasUniversalisResource()];case 3:return e.sent(),this.resources.length>this.limitResources&&(this.resources=this.resources.slice(0,this.limitResources)),[2]}}))}))},this.fetchFavorites=function(t){return n(e,void 0,void 0,(function(){var e,i,n;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,a.http)().get(t)];case 1:return"ok"===(e=r.sent()).status&&e&&e.data&&e.data.length>0&&(i=e.data,this.resources=this.resources.concat(i)),[3,3];case 2:throw n=r.sent(),console.warn("[widget.mediacentre] Failed to fetch favorites : ",n),n;case 3:return[2]}}))}))},this.initResourcesFavorites=function(){return n(e,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.fetchFavorites("/mediacentre/favorites")];case 1:return t.sent(),[3,3];case 2:throw e=t.sent(),console.warn("[widget.mediacentre] Failed to initResourcesFavorites : ",e),e;case 3:return[2]}}))}))},this.initSignetFavorites=function(){return n(e,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.fetchFavorites("/mediacentre/signets/favorites")];case 1:return t.sent(),[3,3];case 2:throw e=t.sent(),console.warn("[widget.mediacentre] Failed to initSignetFavorites : ",e),e;case 3:return[2]}}))}))},this.hasUniversalisResource=function(){return n(e,void 0,void 0,(function(){var e,t;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(0,a.http)().get("/mediacentre/resource/universalis")];case 1:return e=i.sent(),this.hasUniversalis=!!e,[3,3];case 2:throw t=i.sent(),console.warn("[widget.mediacentre] Failed to check exitence of universalis resource: ",t),t;case 3:return[2]}}))}))}}return Object.defineProperty(e.prototype,"description",{get:function(){return(0,a.session)().description},enumerable:!1,configurable:!0}),e.prototype.initializeUniversalis=function(){var e,t;return n(this,void 0,void 0,(function(){var i,n=this;return r(this,(function(r){switch(r.label){case 0:return this.hasUniversalis?(this._userPref=null===(e=c.WidgetFrameworkFactory.instance().list.find((function(e){return e.platformConf.name===c.WIDGET_NAME.MEDIACENTRE})))||void 0===e?void 0:e.userPref,[4,(0,a.notif)().onSessionReady().promise]):[2];case 1:return r.sent(),i=0,(null===(t=this._userPref)||void 0===t?void 0:t.schoolId)&&o.default.isArray(this.description.schools)&&(i=this.description.schools.findIndex((function(e){var t;return e.id===(null===(t=n._userPref)||void 0===t?void 0:t.schoolId)})),i<0&&(i=0)),this.setSelectedSchool(i),[2]}}))}))},e.prototype.setSelectedSchool=function(e){return 0<=e&&e<this.description.schools.length&&this.selectedSchool!==this.description.schools[e]&&(this.selectedSchool=this.description.schools[e],!0)},e}(),d=function(){function e(e){this.$compile=e,this.restrict="E",this.template=i(1058).Z,this.scope={},this.bindToController=!0,this.controller=[l],this.controllerAs="ctrl",this.require=["odeMediacentreWidget"]}return e.prototype.link=function(e,t,i,s){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:return(t=s?s[0]:null)?[4,t.initResources()]:[2];case 1:return i.sent(),[4,t.initializeUniversalis()];case 2:return i.sent(),e.$apply(),e.trackEvent=function(e,t){var i;void 0===t.bubbles&&(t.bubbles=!0);var n=null;t&&"more"===(null===(i=t.detail)||void 0===i?void 0:i.open)&&(n=new CustomEvent(a.TrackedActionFromWidget.mediacentre,t)),n&&e.currentTarget&&e.currentTarget.dispatchEvent(n)},[2]}}))}))},e}();function u(e){return new d(e)}u.$inject=["$compile"],(0,a.notif)().onLangReady().promise.then((function(e){(0,a.conf)().Platform.idiom.addKeys(i(3948))})),t.odeModuleName="odeMediacentreWidgetModule",o.default.module(t.odeModuleName,[]).directive("odeMediacentreWidget",u)},3948:e=>{e.exports=JSON.parse('{"mediacentre-widget":"Mes favoris Médiacentre","mediacentre.widget.title":"Mes favoris Médiacentre","mediacentre.widget.more":"voir plus","mediacentre.widget.empty":"Aucune ressource favorite","mediacentre.widget.universalis.no.uai":"UAI non renseigné","mediacentre.widget.universalis.search":"Rechercher dans Universalis"}')}}]);
1
+ "use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[820],{1058:(e,t,i)=>{i.d(t,{Z:()=>n});const n='<style>.widget-mediacentre .widget-body{max-height:300px;overflow:auto}.widget-mediacentre .widget-body .empty{display:flex;align-items:center;justify-content:center;padding:8px;font-style:italic}.widget-mediacentre .widget-body .resource-list{display:flex;flex-wrap:wrap}.widget-mediacentre .widget-body .resource-list-item{position:relative;width:25%;height:150px}.widget-mediacentre .widget-body .resource-list-item a{display:flex;flex-direction:column;align-items:center;justify-content:center;transition:background-color .8s cubic-bezier(.25,.46,.45,.94);position:relative;margin:1px;padding:0 8px;color:unset;text-decoration:none;background:#fafafa;height:99%;width:auto}.widget-mediacentre .widget-body .resource-list-item a:hover{background-color:#fff;color:#ff8d2e;cursor:pointer}.widget-mediacentre .widget-body .resource-list-item .picture{height:80%;display:flex;align-items:center;justify-content:center}.widget-mediacentre .widget-body .resource-list-item .picture img{max-height:100%;max-width:100%}.widget-mediacentre .widget-body .resource-list-item .title{height:20%;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.widget-mediacentre #universalis-container .widget-body{padding:10px 0}.widget-mediacentre #universalis-container .widget-empty-message{display:flex;align-items:center;justify-content:space-between;padding:12px}.widget-mediacentre #universalis-container .widget-empty-message:first-child,.widget-mediacentre #universalis-container form{max-height:40px}.widget-mediacentre #universalis-container .widget-empty-message form *,.widget-mediacentre #universalis-container .widget-empty-message:first-child *{max-height:inherit}.widget-mediacentre #universalis-container img{width:auto}.widget-mediacentre #universalis-container form{width:90%}.widget-mediacentre #universalis-container form .input-group input#inputUniversalisQ{height:30px}.widget-mediacentre #universalis-container form .input-group button{padding:0 8px}</style> <div class="widget-mediacentre"> <div class="widget-header"> <div class="subtitle"> <a class="seemore" href="/mediacentre" i18n-title="mediacentre.widget.more" dnd-nodrag ng-click="trackEvent($event, {detail:{\'open\':\'more\'} })"> <i18n>mediacentre.widget.title</i18n> <span class="seemore-text"><i18n>mediacentre.widget.more</i18n></span> </a> </div> <div class="widget-options"> <div class="widget-handle" title="Déplacer le widget"><i class="fas fa-grip-vertical" aria-hidden="true"></i></div> </div> </div> <div class="widget-body" dnd-nodrag> <ul class="resource-list" ng-if="ctrl.resources.length > 0"> <li class="resource-list-item" ng-repeat="resource in ctrl.resources" title="[[resource.title]]"> <a ng-href="[[resource.link]]" target="_blank"> <div class="picture"><img skin-src="[[resource.image]]" alt="[[resource.title]]"/></div> <div class="title">[[resource.title]]</div> </a> </li> </ul> <div class="empty" ng-if="ctrl.resources.length <= 0"> <i18n>mediacentre.widget.empty</i18n> </div> </div> <div class="widget-footer border-top border-ghost" ng-if="ctrl.hasUniversalis"> <div id="universalis-container"> <div class="widget-body"> <div class="widget-empty-message"> <div class="row row-cols-1 align-items-center"> <div class="mb-3"> <a href="http://www.universalis-edu.com" target="_blank" rel="noopener" ng-click="trackEvent($event, {detail:{\'open\':\'universalis\'} })"> <img src="/assets/widgets/mediacentre-widget/universalis.png" width="75" alt="Universalis"> </a> </div> </div> <form method="GET" action="https://www.universalis-edu.com/nomade/precherche/" target="_blank" autocomplete="off"> <div class="row row-cols-1 align-items-center"> <label class="sr-only" for="inputUniversalisQ" translate content="{{ctrl.selectedSchool.UAI == null ? \'mediacentre.widget.universalis.no.uai\' : \'mediacentre.widget.universalis.search\'}}"></label> <div class="input-group mb-2"> <input type="text" id="inputUniversalisQ" class="form-control" name="q" maxlen gth="255" i18n-placeholder="{{ctrl.selectedSchool.UAI == null ? \'mediacentre.widget.universalis.no.uai\' : \'mediacentre.widget.universalis.search\'}}" ng-disabled="ctrl.selectedSchool.UAI == null"/> <input type="hidden" name="r" value="www"/> <input type="hidden" name="uai" value="{{ctrl.selectedSchool.UAI}}"/> <button class="btn btn-outline-secondary" ng-class="{\'disabled\': ctrl.selectedSchool.UAI == null}" aria-labelledby="inputUniversalisQ" ng-click="trackEvent($event, {detail:{\'search\':\'launch\'} })"> <i class="ic-search"></i> </button> </div> </div> </form> </div> </div> </div> </div> </div>'},5116:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}c((n=n.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.odeModuleName=void 0;var o=s(i(4202)),a=i(9419),c=i(5262),l=function(){function e(){var e=this;this.resources=[],this.limitResources=4,this.hasUniversalis=!1,this.initResources=function(){return n(e,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.initResourcesFavorites()];case 1:return e.sent(),[4,this.initSignetFavorites()];case 2:return e.sent(),[4,this.hasUniversalisResource()];case 3:return e.sent(),this.resources.length>this.limitResources&&(this.resources=this.resources.slice(0,this.limitResources)),[2]}})})},this.fetchFavorites=function(t){return n(e,void 0,void 0,function(){var e,i,n;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,a.http)().get(t)];case 1:return"ok"===(e=r.sent()).status&&e&&e.data&&e.data.length>0&&(i=e.data,this.resources=this.resources.concat(i)),[3,3];case 2:throw n=r.sent(),console.warn("[widget.mediacentre] Failed to fetch favorites : ",n),n;case 3:return[2]}})})},this.initResourcesFavorites=function(){return n(e,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.fetchFavorites("/mediacentre/favorites")];case 1:return t.sent(),[3,3];case 2:throw e=t.sent(),console.warn("[widget.mediacentre] Failed to initResourcesFavorites : ",e),e;case 3:return[2]}})})},this.initSignetFavorites=function(){return n(e,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.fetchFavorites("/mediacentre/signets/favorites")];case 1:return t.sent(),[3,3];case 2:throw e=t.sent(),console.warn("[widget.mediacentre] Failed to initSignetFavorites : ",e),e;case 3:return[2]}})})},this.hasUniversalisResource=function(){return n(e,void 0,void 0,function(){var e,t;return r(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(0,a.http)().get("/mediacentre/resource/universalis")];case 1:return e=i.sent(),this.hasUniversalis=!!e,[3,3];case 2:throw t=i.sent(),console.warn("[widget.mediacentre] Failed to check exitence of universalis resource: ",t),t;case 3:return[2]}})})}}return Object.defineProperty(e.prototype,"description",{get:function(){return(0,a.session)().description},enumerable:!1,configurable:!0}),e.prototype.initializeUniversalis=function(){var e,t;return n(this,void 0,void 0,function(){var i,n=this;return r(this,function(r){switch(r.label){case 0:return this.hasUniversalis?(this._userPref=null===(e=c.WidgetFrameworkFactory.instance().list.find(function(e){return e.platformConf.name===c.WIDGET_NAME.MEDIACENTRE}))||void 0===e?void 0:e.userPref,[4,(0,a.notif)().onSessionReady().promise]):[2];case 1:return r.sent(),i=0,(null===(t=this._userPref)||void 0===t?void 0:t.schoolId)&&o.default.isArray(this.description.schools)&&(i=this.description.schools.findIndex(function(e){var t;return e.id===(null===(t=n._userPref)||void 0===t?void 0:t.schoolId)}),i<0&&(i=0)),this.setSelectedSchool(i),[2]}})})},e.prototype.setSelectedSchool=function(e){return 0<=e&&e<this.description.schools.length&&this.selectedSchool!==this.description.schools[e]&&(this.selectedSchool=this.description.schools[e],!0)},e}(),d=function(){function e(e){this.$compile=e,this.restrict="E",this.template=i(1058).Z,this.scope={},this.bindToController=!0,this.controller=[l],this.controllerAs="ctrl",this.require=["odeMediacentreWidget"]}return e.prototype.link=function(e,t,i,s){return n(this,void 0,void 0,function(){var t;return r(this,function(i){switch(i.label){case 0:return(t=s?s[0]:null)?[4,t.initResources()]:[2];case 1:return i.sent(),[4,t.initializeUniversalis()];case 2:return i.sent(),e.$apply(),e.trackEvent=function(e,t){var i;void 0===t.bubbles&&(t.bubbles=!0);var n=null;t&&"more"===(null===(i=t.detail)||void 0===i?void 0:i.open)&&(n=new CustomEvent(a.TrackedActionFromWidget.mediacentre,t)),n&&e.currentTarget&&e.currentTarget.dispatchEvent(n)},[2]}})})},e}();function u(e){return new d(e)}u.$inject=["$compile"],(0,a.notif)().onLangReady().promise.then(function(e){(0,a.conf)().Platform.idiom.addKeys(i(3948))}),t.odeModuleName="odeMediacentreWidgetModule",o.default.module(t.odeModuleName,[]).directive("odeMediacentreWidget",u)},3948:e=>{e.exports=JSON.parse('{"mediacentre-widget":"Mes favoris Médiacentre","mediacentre.widget.title":"Mes favoris Médiacentre","mediacentre.widget.more":"voir plus","mediacentre.widget.empty":"Aucune ressource favorite","mediacentre.widget.universalis.no.uai":"UAI non renseigné","mediacentre.widget.universalis.search":"Rechercher dans Universalis"}')}}]);
2
2
  //# sourceMappingURL=mediacentre-widget.widget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"widgets/mediacentre-widget/mediacentre-widget.widget.js","mappings":"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","sources":["webpack://ode-ngjs-front/./src/ts/widgets/mediacentre-widget/mediacentre-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/mediacentre-widget/mediacentre-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<style>.widget-mediacentre .widget-body{max-height:300px;overflow:auto}.widget-mediacentre .widget-body .empty{display:flex;align-items:center;justify-content:center;padding:8px;font-style:italic}.widget-mediacentre .widget-body .resource-list{display:flex;flex-wrap:wrap}.widget-mediacentre .widget-body .resource-list-item{position:relative;width:25%;height:150px}.widget-mediacentre .widget-body .resource-list-item a{display:flex;flex-direction:column;align-items:center;justify-content:center;transition:background-color .8s cubic-bezier(.25,.46,.45,.94);position:relative;margin:1px;padding:0 8px;color:unset;text-decoration:none;background:#fafafa;height:99%;width:auto}.widget-mediacentre .widget-body .resource-list-item a:hover{background-color:#fff;color:#ff8d2e;cursor:pointer}.widget-mediacentre .widget-body .resource-list-item .picture{height:80%;display:flex;align-items:center;justify-content:center}.widget-mediacentre .widget-body .resource-list-item .picture img{max-height:100%;max-width:100%}.widget-mediacentre .widget-body .resource-list-item .title{height:20%;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.widget-mediacentre #universalis-container .widget-body{padding:10px 0}.widget-mediacentre #universalis-container .widget-empty-message{display:flex;align-items:center;justify-content:space-between;padding:12px}.widget-mediacentre #universalis-container .widget-empty-message:first-child,.widget-mediacentre #universalis-container form{max-height:40px}.widget-mediacentre #universalis-container .widget-empty-message form *,.widget-mediacentre #universalis-container .widget-empty-message:first-child *{max-height:inherit}.widget-mediacentre #universalis-container img{width:auto}.widget-mediacentre #universalis-container form{width:90%}.widget-mediacentre #universalis-container form .input-group input#inputUniversalisQ{height:30px}.widget-mediacentre #universalis-container form .input-group button{padding:0 8px}</style> <div class=\\\"widget-mediacentre\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"> <a class=\\\"seemore\\\" href=\\\"/mediacentre\\\" i18n-title=\\\"mediacentre.widget.more\\\" dnd-nodrag ng-click=\\\"trackEvent($event, {detail:{'open':'more'} })\\\"> <i18n>mediacentre.widget.title</i18n> <span class=\\\"seemore-text\\\"><i18n>mediacentre.widget.more</i18n></span> </a> </div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\" title=\\\"Déplacer le widget\\\"><i class=\\\"fas fa-grip-vertical\\\" aria-hidden=\\\"true\\\"></i></div> </div> </div> <div class=\\\"widget-body\\\" dnd-nodrag> <ul class=\\\"resource-list\\\" ng-if=\\\"ctrl.resources.length > 0\\\"> <li class=\\\"resource-list-item\\\" ng-repeat=\\\"resource in ctrl.resources\\\" title=\\\"[[resource.title]]\\\"> <a ng-href=\\\"[[resource.link]]\\\" target=\\\"_blank\\\"> <div class=\\\"picture\\\"><img skin-src=\\\"[[resource.image]]\\\" alt=\\\"[[resource.title]]\\\"/></div> <div class=\\\"title\\\">[[resource.title]]</div> </a> </li> </ul> <div class=\\\"empty\\\" ng-if=\\\"ctrl.resources.length <= 0\\\"> <i18n>mediacentre.widget.empty</i18n> </div> </div> <div class=\\\"widget-footer border-top border-ghost\\\" ng-if=\\\"ctrl.hasUniversalis\\\"> <div id=\\\"universalis-container\\\"> <div class=\\\"widget-body\\\"> <div class=\\\"widget-empty-message\\\"> <div class=\\\"row row-cols-1 align-items-center\\\"> <div class=\\\"mb-3\\\"> <a href=\\\"http://www.universalis-edu.com\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'universalis'} })\\\"> <img src=\\\"/assets/widgets/mediacentre-widget/universalis.png\\\" width=\\\"75\\\" alt=\\\"Universalis\\\"> </a> </div> </div> <form method=\\\"GET\\\" action=\\\"https://www.universalis-edu.com/nomade/precherche/\\\" target=\\\"_blank\\\" autocomplete=\\\"off\\\"> <div class=\\\"row row-cols-1 align-items-center\\\"> <label class=\\\"sr-only\\\" for=\\\"inputUniversalisQ\\\" translate content=\\\"{{ctrl.selectedSchool.UAI == null ? 'mediacentre.widget.universalis.no.uai' : 'mediacentre.widget.universalis.search'}}\\\"></label> <div class=\\\"input-group mb-2\\\"> <input type=\\\"text\\\" id=\\\"inputUniversalisQ\\\" class=\\\"form-control\\\" name=\\\"q\\\" maxlen gth=\\\"255\\\" i18n-placeholder=\\\"{{ctrl.selectedSchool.UAI == null ? 'mediacentre.widget.universalis.no.uai' : 'mediacentre.widget.universalis.search'}}\\\" ng-disabled=\\\"ctrl.selectedSchool.UAI == null\\\"/> <input type=\\\"hidden\\\" name=\\\"r\\\" value=\\\"www\\\"/> <input type=\\\"hidden\\\" name=\\\"uai\\\" value=\\\"{{ctrl.selectedSchool.UAI}}\\\"/> <button class=\\\"btn btn-outline-secondary\\\" ng-class=\\\"{'disabled': ctrl.selectedSchool.UAI == null}\\\" aria-labelledby=\\\"inputUniversalisQ\\\" ng-click=\\\"trackEvent($event, {detail:{'search':'launch'} })\\\"> <i class=\\\"ic-search\\\"></i> </button> </div> </div> </form> </div> </div> </div> </div> </div>\";\n// Exports\nexport default code;","import angular, {IAttributes, ICompileService, IController, IDirective} from \"angular\";\nimport {conf, notif, TrackedScope, TrackedAction, TrackedActionFromWidget, http, session} from \"../../utils\";\nimport {IUserDescription, School, WIDGET_NAME, WidgetFrameworkFactory, WidgetUserPref} from \"ode-ts-client\";\n\ntype Resource = {\n authors: string[];\n date: number;\n description: string;\n disciplines: string[];\n displayTitle: string;\n document_types: string[];\n editors: string[];\n hash: number;\n id: string;\n favorite?: boolean;\n image: string;\n levels: string[];\n link: string;\n plain_text: string[];\n source: string;\n title: string;\n action: object;\n structure_name: string;\n structure_uai: string;\n display_structure_name?: boolean;\n _id?: string;\n\n user?: string;\n favoriteId?: string;\n}\n\ntype Response = {\n data: Resource[];\n event: string;\n state: string;\n status: string;\n}\n\n/* Controller for the directive */\nclass Controller implements IController {\n private resources: Resource[] = [];\n private limitResources: number = 4; // limit of resources to display\n public hasUniversalis: boolean = false;\n\n public initResources = async(): Promise<void> => {\n await this.initResourcesFavorites();\n await this.initSignetFavorites();\n await this.hasUniversalisResource();\n if (this.resources.length > this.limitResources) this.resources = this.resources.slice(0, this.limitResources);\n }\n\n private fetchFavorites = async (apiUrl: string): Promise<void> => {\n try {\n let response: Response = await http().get<Response>(apiUrl);\n if (response.status === \"ok\" && response && response.data && response.data.length > 0) {\n let favoriteResources: Resource[] = response.data as Resource[];\n this.resources = this.resources.concat(favoriteResources);\n }\n } catch (e) {\n console.warn(`[widget.mediacentre] Failed to fetch favorites : `, e);\n throw e;\n }\n }\n\n private initResourcesFavorites = async(): Promise<void> => {\n try {\n await this.fetchFavorites('/mediacentre/favorites');\n } catch (e) {\n console.warn(\"[widget.mediacentre] Failed to initResourcesFavorites : \", e);\n throw e;\n }\n }\n\n private initSignetFavorites = async(): Promise<void> => {\n try {\n await this.fetchFavorites('/mediacentre/signets/favorites');\n } catch (e) {\n console.warn(\"[widget.mediacentre] Failed to initSignetFavorites : \", e);\n throw e;\n }\n }\n\n private hasUniversalisResource = async(): Promise<void> => {\n try {\n let universalisResource: Resource = await http().get<Resource>('/mediacentre/resource/universalis');\n this.hasUniversalis = !!universalisResource;\n } catch (e) {\n console.warn(\"[widget.mediacentre] Failed to check exitence of universalis resource: \", e);\n throw e;\n }\n }\n\n\n // Universalis\n\n private _userPref?:WidgetUserPref;\n private selectedSchool?:School;\n\n protected get description():IUserDescription {\n return session().description;\n }\n\n public async initializeUniversalis() {\n if (!this.hasUniversalis) return;\n\n this._userPref = WidgetFrameworkFactory.instance().list.find( w => w.platformConf.name===WIDGET_NAME.MEDIACENTRE)?.userPref;\n await notif().onSessionReady().promise;\n\n let defaultIndex = 0;\n if( this._userPref?.schoolId && angular.isArray(this.description.schools) ) {\n defaultIndex = this.description.schools.findIndex( school => school.id===this._userPref?.schoolId );\n if( defaultIndex < 0 ) {\n defaultIndex = 0;\n }\n }\n this.setSelectedSchool( defaultIndex );\n }\n\n private setSelectedSchool( idx:number ):boolean {\n if( 0 <= idx && idx < this.description.schools.length && this.selectedSchool !== this.description.schools[idx]) {\n this.selectedSchool = this.description.schools[idx];\n return true;\n }\n return false;\n }\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n template = require('./mediacentre-widget.widget.html').default;\n scope = {};\n bindToController = true;\n controller = [Controller];\n controllerAs = 'ctrl';\n require = ['odeMediacentreWidget'];\n\n async link (scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]): Promise<void> {\n const ctrl: Controller|null = controllers ? controllers[0] as Controller : null;\n if (!ctrl) return;\n\n await ctrl.initResources(); // Init Mediacentre resources\n await ctrl.initializeUniversalis(); // Init Universalis search bar\n scope.$apply();\n\n // Give an opportunity to track some events from outside of this widget.\n scope.trackEvent = (e:Event, p:CustomEventInit<TrackedAction>): void => {\n // Allow events to bubble up.\n if (typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n let event = null;\n if (p && p.detail?.open === 'more') {\n event = new CustomEvent( TrackedActionFromWidget.mediacentre, p );\n }\n if (event && e.currentTarget) {\n e.currentTarget.dispatchEvent(event);\n }\n }\n }\n\n constructor (private $compile: ICompileService) { }\n}\n\n/** The mediacentre widget. */\nfunction DirectiveFactory($compile:ICompileService) {\n return new Directive($compile);\n}\nDirectiveFactory.$inject = [\"$compile\"];\n\n// Preload translations\nnotif().onLangReady().promise.then((lang: any): void => {\n switch (lang) {\n default:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n }\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeMediacentreWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeMediacentreWidget\", DirectiveFactory );\n"],"names":["resources","limitResources","hasUniversalis","initResources","this","initResourcesFavorites","initSignetFavorites","hasUniversalisResource","length","slice","fetchFavorites","apiUrl","http","get","response","status","data","favoriteResources","concat","console","warn","universalisResource","session","description","initializeUniversalis","_userPref","WidgetFrameworkFactory","instance","list","find","w","platformConf","name","WIDGET_NAME","MEDIACENTRE","userPref","notif","onSessionReady","promise","defaultIndex","schoolId","isArray","schools","findIndex","school","id","setSelectedSchool","idx","selectedSchool","$compile","restrict","template","scope","bindToController","controller","Controller","controllerAs","require","link","elem","attrs","controllers","ctrl","$apply","trackEvent","e","p","bubbles","event","detail","open","CustomEvent","TrackedActionFromWidget","mediacentre","currentTarget","dispatchEvent","DirectiveFactory","Directive","$inject","onLangReady","then","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive"],"sourceRoot":""}
1
+ {"version":3,"file":"widgets/mediacentre-widget/mediacentre-widget.widget.js","mappings":"gIAGA,QAFW,+9I,0iDCDX,iBACA,UACA,UAqCA,qCACY,KAAAA,UAAwB,GACxB,KAAAC,eAAyB,EAC1B,KAAAC,gBAA0B,EAE1B,KAAAC,cAAgB,+C,iDACnB,SAAMC,KAAKC,0B,OACX,OADA,SACA,GAAMD,KAAKE,uB,OACX,OADA,SACA,GAAMF,KAAKG,0B,cAAX,SACIH,KAAKJ,UAAUQ,OAASJ,KAAKH,iBAAgBG,KAAKJ,UAAYI,KAAKJ,UAAUS,MAAM,EAAGL,KAAKH,iB,UAG3F,KAAAS,eAAiB,SAAOC,GAAc,oC,2DAEb,O,sBAAA,IAAM,IAAAC,QAAOC,IAAcF,I,aAC3B,QADrBG,EAAqB,UACZC,QAAoBD,GAAYA,EAASE,MAAQF,EAASE,KAAKR,OAAS,IAC7ES,EAAgCH,EAASE,KAC7CZ,KAAKJ,UAAYI,KAAKJ,UAAUkB,OAAOD,I,aAI3C,M,WADAE,QAAQC,KAAK,oDAAqD,GAC5D,E,uBAIN,KAAAf,uBAAyB,+C,uDAEzB,O,sBAAA,GAAMD,KAAKM,eAAe,2B,cAA1B,S,aAGA,M,WADAS,QAAQC,KAAK,2DAA4D,GACnE,E,uBAIN,KAAAd,oBAAsB,+C,uDAEtB,O,sBAAA,GAAMF,KAAKM,eAAe,mC,cAA1B,S,aAGA,M,WADAS,QAAQC,KAAK,wDAAyD,GAChE,E,uBAIN,KAAAb,uBAAyB,+C,yDAEW,O,sBAAA,IAAM,IAAAK,QAAOC,IAAc,sC,cAA3DQ,EAAgC,SACpCjB,KAAKF,iBAAmBmB,E,aAGxB,M,WADAF,QAAQC,KAAK,0EAA2E,GAClF,E,sBAqClB,QA3BI,sBAAc,0BAAW,C,IAAzB,WACI,OAAO,IAAAE,WAAUC,WACrB,E,gCAEa,YAAAC,sBAAb,W,6GACI,OAAKpB,KAAKF,gBAEVE,KAAKqB,UAA4G,QAAhG,IAAAC,uBAAuBC,WAAWC,KAAKC,KAAM,SAAAC,GAAK,OAAAA,EAAEC,aAAaC,OAAO,EAAAC,YAAYC,WAAlC,UAA8C,eAAEC,SACnH,IAAM,IAAAC,SAAQC,iBAAiBC,UAHL,I,cAG1B,SAEIC,EAAe,GACD,QAAd,EAAAnC,KAAKqB,iBAAS,eAAEe,WAAY,UAAQC,QAAQrC,KAAKmB,YAAYmB,WAC7DH,EAAenC,KAAKmB,YAAYmB,QAAQC,UAAW,SAAAC,GAAM,MAAI,OAAAA,EAAOC,MAAmB,QAAd,IAAKpB,iBAAS,eAAEe,SAAQ,GAC7FD,EAAe,IACfA,EAAe,IAGvBnC,KAAK0C,kBAAmBP,G,UAGpB,YAAAO,kBAAR,SAA2BC,GACvB,OAAI,GAAKA,GAAOA,EAAM3C,KAAKmB,YAAYmB,QAAQlC,QAAUJ,KAAK4C,iBAAmB5C,KAAKmB,YAAYmB,QAAQK,KACtG3C,KAAK4C,eAAiB5C,KAAKmB,YAAYmB,QAAQK,IACxC,EAGf,EACJ,EAtFA,GAyFA,aAgCI,WAAqBE,GAAA,KAAAA,SAAAA,EA/BrB,KAAAC,SAAW,IACX,KAAAC,SAAW,UACX,KAAAC,MAAQ,CAAC,EACT,KAAAC,kBAAmB,EACnB,KAAAC,WAAa,CAACC,GACd,KAAAC,aAAe,OACf,KAAAC,QAAU,CAAC,uBAyBuC,CACtD,OAxBU,YAAAC,KAAN,SAAYN,EAAoBO,EAAaC,EAAmBC,G,8FAE5D,OADMC,EAAwBD,EAAcA,EAAY,GAAmB,MAG3E,GAAMC,EAAK3D,iBAFA,I,OAGX,OADA,SACA,GAAM2D,EAAKtC,yB,cAAX,SACA4B,EAAMW,SAGNX,EAAMY,WAAa,SAACC,EAASC,G,WAEA,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAElD,IAAIC,EAAQ,KACRF,GAAwB,UAAX,QAAR,EAAAA,EAAEG,cAAM,eAAEC,QACfF,EAAQ,IAAIG,YAAa,EAAAC,wBAAwBC,YAAaP,IAE9DE,GAASH,EAAES,eACXT,EAAES,cAAcC,cAAcP,EAEtC,E,UAIR,EAjCA,GAoCA,SAASQ,EAAiB3B,GACtB,OAAO,IAAI4B,EAAU5B,EACzB,CACA2B,EAAiBE,QAAU,CAAC,aAG5B,IAAA1C,SAAQ2C,cAAczC,QAAQ0C,KAAK,SAACC,IAEnB,IAAAC,QAAOC,SAASC,MAAMC,QAAS,EAAQ,MAExD,GAIa,EAAAC,cAAgB,6BAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,uBAAwBZ,E","sources":["webpack://ode-ngjs-front/./src/ts/widgets/mediacentre-widget/mediacentre-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/mediacentre-widget/mediacentre-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<style>.widget-mediacentre .widget-body{max-height:300px;overflow:auto}.widget-mediacentre .widget-body .empty{display:flex;align-items:center;justify-content:center;padding:8px;font-style:italic}.widget-mediacentre .widget-body .resource-list{display:flex;flex-wrap:wrap}.widget-mediacentre .widget-body .resource-list-item{position:relative;width:25%;height:150px}.widget-mediacentre .widget-body .resource-list-item a{display:flex;flex-direction:column;align-items:center;justify-content:center;transition:background-color .8s cubic-bezier(.25,.46,.45,.94);position:relative;margin:1px;padding:0 8px;color:unset;text-decoration:none;background:#fafafa;height:99%;width:auto}.widget-mediacentre .widget-body .resource-list-item a:hover{background-color:#fff;color:#ff8d2e;cursor:pointer}.widget-mediacentre .widget-body .resource-list-item .picture{height:80%;display:flex;align-items:center;justify-content:center}.widget-mediacentre .widget-body .resource-list-item .picture img{max-height:100%;max-width:100%}.widget-mediacentre .widget-body .resource-list-item .title{height:20%;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.widget-mediacentre #universalis-container .widget-body{padding:10px 0}.widget-mediacentre #universalis-container .widget-empty-message{display:flex;align-items:center;justify-content:space-between;padding:12px}.widget-mediacentre #universalis-container .widget-empty-message:first-child,.widget-mediacentre #universalis-container form{max-height:40px}.widget-mediacentre #universalis-container .widget-empty-message form *,.widget-mediacentre #universalis-container .widget-empty-message:first-child *{max-height:inherit}.widget-mediacentre #universalis-container img{width:auto}.widget-mediacentre #universalis-container form{width:90%}.widget-mediacentre #universalis-container form .input-group input#inputUniversalisQ{height:30px}.widget-mediacentre #universalis-container form .input-group button{padding:0 8px}</style> <div class=\\\"widget-mediacentre\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"> <a class=\\\"seemore\\\" href=\\\"/mediacentre\\\" i18n-title=\\\"mediacentre.widget.more\\\" dnd-nodrag ng-click=\\\"trackEvent($event, {detail:{'open':'more'} })\\\"> <i18n>mediacentre.widget.title</i18n> <span class=\\\"seemore-text\\\"><i18n>mediacentre.widget.more</i18n></span> </a> </div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\" title=\\\"Déplacer le widget\\\"><i class=\\\"fas fa-grip-vertical\\\" aria-hidden=\\\"true\\\"></i></div> </div> </div> <div class=\\\"widget-body\\\" dnd-nodrag> <ul class=\\\"resource-list\\\" ng-if=\\\"ctrl.resources.length > 0\\\"> <li class=\\\"resource-list-item\\\" ng-repeat=\\\"resource in ctrl.resources\\\" title=\\\"[[resource.title]]\\\"> <a ng-href=\\\"[[resource.link]]\\\" target=\\\"_blank\\\"> <div class=\\\"picture\\\"><img skin-src=\\\"[[resource.image]]\\\" alt=\\\"[[resource.title]]\\\"/></div> <div class=\\\"title\\\">[[resource.title]]</div> </a> </li> </ul> <div class=\\\"empty\\\" ng-if=\\\"ctrl.resources.length <= 0\\\"> <i18n>mediacentre.widget.empty</i18n> </div> </div> <div class=\\\"widget-footer border-top border-ghost\\\" ng-if=\\\"ctrl.hasUniversalis\\\"> <div id=\\\"universalis-container\\\"> <div class=\\\"widget-body\\\"> <div class=\\\"widget-empty-message\\\"> <div class=\\\"row row-cols-1 align-items-center\\\"> <div class=\\\"mb-3\\\"> <a href=\\\"http://www.universalis-edu.com\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'universalis'} })\\\"> <img src=\\\"/assets/widgets/mediacentre-widget/universalis.png\\\" width=\\\"75\\\" alt=\\\"Universalis\\\"> </a> </div> </div> <form method=\\\"GET\\\" action=\\\"https://www.universalis-edu.com/nomade/precherche/\\\" target=\\\"_blank\\\" autocomplete=\\\"off\\\"> <div class=\\\"row row-cols-1 align-items-center\\\"> <label class=\\\"sr-only\\\" for=\\\"inputUniversalisQ\\\" translate content=\\\"{{ctrl.selectedSchool.UAI == null ? 'mediacentre.widget.universalis.no.uai' : 'mediacentre.widget.universalis.search'}}\\\"></label> <div class=\\\"input-group mb-2\\\"> <input type=\\\"text\\\" id=\\\"inputUniversalisQ\\\" class=\\\"form-control\\\" name=\\\"q\\\" maxlen gth=\\\"255\\\" i18n-placeholder=\\\"{{ctrl.selectedSchool.UAI == null ? 'mediacentre.widget.universalis.no.uai' : 'mediacentre.widget.universalis.search'}}\\\" ng-disabled=\\\"ctrl.selectedSchool.UAI == null\\\"/> <input type=\\\"hidden\\\" name=\\\"r\\\" value=\\\"www\\\"/> <input type=\\\"hidden\\\" name=\\\"uai\\\" value=\\\"{{ctrl.selectedSchool.UAI}}\\\"/> <button class=\\\"btn btn-outline-secondary\\\" ng-class=\\\"{'disabled': ctrl.selectedSchool.UAI == null}\\\" aria-labelledby=\\\"inputUniversalisQ\\\" ng-click=\\\"trackEvent($event, {detail:{'search':'launch'} })\\\"> <i class=\\\"ic-search\\\"></i> </button> </div> </div> </form> </div> </div> </div> </div> </div>\";\n// Exports\nexport default code;","import angular, {IAttributes, ICompileService, IController, IDirective} from \"angular\";\nimport {conf, notif, TrackedScope, TrackedAction, TrackedActionFromWidget, http, session} from \"../../utils\";\nimport {IUserDescription, School, WIDGET_NAME, WidgetFrameworkFactory, WidgetUserPref} from \"ode-ts-client\";\n\ntype Resource = {\n authors: string[];\n date: number;\n description: string;\n disciplines: string[];\n displayTitle: string;\n document_types: string[];\n editors: string[];\n hash: number;\n id: string;\n favorite?: boolean;\n image: string;\n levels: string[];\n link: string;\n plain_text: string[];\n source: string;\n title: string;\n action: object;\n structure_name: string;\n structure_uai: string;\n display_structure_name?: boolean;\n _id?: string;\n\n user?: string;\n favoriteId?: string;\n}\n\ntype Response = {\n data: Resource[];\n event: string;\n state: string;\n status: string;\n}\n\n/* Controller for the directive */\nclass Controller implements IController {\n private resources: Resource[] = [];\n private limitResources: number = 4; // limit of resources to display\n public hasUniversalis: boolean = false;\n\n public initResources = async(): Promise<void> => {\n await this.initResourcesFavorites();\n await this.initSignetFavorites();\n await this.hasUniversalisResource();\n if (this.resources.length > this.limitResources) this.resources = this.resources.slice(0, this.limitResources);\n }\n\n private fetchFavorites = async (apiUrl: string): Promise<void> => {\n try {\n let response: Response = await http().get<Response>(apiUrl);\n if (response.status === \"ok\" && response && response.data && response.data.length > 0) {\n let favoriteResources: Resource[] = response.data as Resource[];\n this.resources = this.resources.concat(favoriteResources);\n }\n } catch (e) {\n console.warn(`[widget.mediacentre] Failed to fetch favorites : `, e);\n throw e;\n }\n }\n\n private initResourcesFavorites = async(): Promise<void> => {\n try {\n await this.fetchFavorites('/mediacentre/favorites');\n } catch (e) {\n console.warn(\"[widget.mediacentre] Failed to initResourcesFavorites : \", e);\n throw e;\n }\n }\n\n private initSignetFavorites = async(): Promise<void> => {\n try {\n await this.fetchFavorites('/mediacentre/signets/favorites');\n } catch (e) {\n console.warn(\"[widget.mediacentre] Failed to initSignetFavorites : \", e);\n throw e;\n }\n }\n\n private hasUniversalisResource = async(): Promise<void> => {\n try {\n let universalisResource: Resource = await http().get<Resource>('/mediacentre/resource/universalis');\n this.hasUniversalis = !!universalisResource;\n } catch (e) {\n console.warn(\"[widget.mediacentre] Failed to check exitence of universalis resource: \", e);\n throw e;\n }\n }\n\n\n // Universalis\n\n private _userPref?:WidgetUserPref;\n private selectedSchool?:School;\n\n protected get description():IUserDescription {\n return session().description;\n }\n\n public async initializeUniversalis() {\n if (!this.hasUniversalis) return;\n\n this._userPref = WidgetFrameworkFactory.instance().list.find( w => w.platformConf.name===WIDGET_NAME.MEDIACENTRE)?.userPref;\n await notif().onSessionReady().promise;\n\n let defaultIndex = 0;\n if( this._userPref?.schoolId && angular.isArray(this.description.schools) ) {\n defaultIndex = this.description.schools.findIndex( school => school.id===this._userPref?.schoolId );\n if( defaultIndex < 0 ) {\n defaultIndex = 0;\n }\n }\n this.setSelectedSchool( defaultIndex );\n }\n\n private setSelectedSchool( idx:number ):boolean {\n if( 0 <= idx && idx < this.description.schools.length && this.selectedSchool !== this.description.schools[idx]) {\n this.selectedSchool = this.description.schools[idx];\n return true;\n }\n return false;\n }\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n template = require('./mediacentre-widget.widget.html').default;\n scope = {};\n bindToController = true;\n controller = [Controller];\n controllerAs = 'ctrl';\n require = ['odeMediacentreWidget'];\n\n async link (scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]): Promise<void> {\n const ctrl: Controller|null = controllers ? controllers[0] as Controller : null;\n if (!ctrl) return;\n\n await ctrl.initResources(); // Init Mediacentre resources\n await ctrl.initializeUniversalis(); // Init Universalis search bar\n scope.$apply();\n\n // Give an opportunity to track some events from outside of this widget.\n scope.trackEvent = (e:Event, p:CustomEventInit<TrackedAction>): void => {\n // Allow events to bubble up.\n if (typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n let event = null;\n if (p && p.detail?.open === 'more') {\n event = new CustomEvent( TrackedActionFromWidget.mediacentre, p );\n }\n if (event && e.currentTarget) {\n e.currentTarget.dispatchEvent(event);\n }\n }\n }\n\n constructor (private $compile: ICompileService) { }\n}\n\n/** The mediacentre widget. */\nfunction DirectiveFactory($compile:ICompileService) {\n return new Directive($compile);\n}\nDirectiveFactory.$inject = [\"$compile\"];\n\n// Preload translations\nnotif().onLangReady().promise.then((lang: any): void => {\n switch (lang) {\n default:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n }\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeMediacentreWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeMediacentreWidget\", DirectiveFactory );\n"],"names":["resources","limitResources","hasUniversalis","initResources","this","initResourcesFavorites","initSignetFavorites","hasUniversalisResource","length","slice","fetchFavorites","apiUrl","http","get","response","status","data","favoriteResources","concat","console","warn","universalisResource","session","description","initializeUniversalis","_userPref","WidgetFrameworkFactory","instance","list","find","w","platformConf","name","WIDGET_NAME","MEDIACENTRE","userPref","notif","onSessionReady","promise","defaultIndex","schoolId","isArray","schools","findIndex","school","id","setSelectedSchool","idx","selectedSchool","$compile","restrict","template","scope","bindToController","controller","Controller","controllerAs","require","link","elem","attrs","controllers","ctrl","$apply","trackEvent","e","p","bubbles","event","detail","open","CustomEvent","TrackedActionFromWidget","mediacentre","currentTarget","dispatchEvent","DirectiveFactory","Directive","$inject","onLangReady","then","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[649],{5052:(e,t,i)=>{i.d(t,{Z:()=>n});const n='<div class="widget-applications"> <div class="widget-header"> <div class="subtitle"><i18n>my-apps.widget.title</i18n></div> <div class="widget-options"> <div class="widget-handle"><i class="fas fa-grip-vertical"></i></div> </div> </div> <div class="widget-body" dnd-nodrag> <div class="widget-empty-message link" ng-if="ctrl.apps.length===0"> <a href="/welcome" ng-click="trackEvent($event, {detail:{\'open\':\'more\'} })"> <i18n>my-apps.widget.more</i18n> </a> </div> <ul class="icon-grid" ng-if="ctrl.apps.length>0"> <li class="icon-grid-item" ng-repeat="app in ctrl.apps"> <a connector-lightbox-trigger="app" ng-href="[[app.address]]" ng-click="trackEvent($event, {detail:{\'open\':\'app\', \'app\':app} })" aria-label="[[app.displayName]]" target="[[app.target]]" rel="noopener" i18n-title="[[app.displayName]]" ng-switch="app.icon.indexOf(\'/\')"> <i ng-class="ctrl.getIconClass(app)" ng-switch-when="-1"></i> <img skin-src="[[app.icon]]" ng-switch-default alt="[[app.displayName]]"/> </a> </li> </ul> </div> <div class="widget-footer border-top border-ghost" ng-if="ctrl.apps.length!==0"> <div class="widget-footer-action"> <a class="link" href="/welcome" ng-click="trackEvent($event, {detail:{\'open\':\'more\'} })"> <i18n>my-apps.widget.options</i18n> </a> </div> </div> </div>'},1204:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.odeModuleName=void 0;var o=n(i(4202)),a=i(9419),p=function(){function e(e){this.themeSvc=e,this.apps=[]}return e.prototype.redirect=function(e){window.location.href=e},e.prototype.getIconClass=function(e){var t=this.themeSvc.getIconCode(e);return"ic-app-".concat(t," color-app-").concat(t)},e}(),s=function(){function e(){this.restrict="E",this.template=i(5052).Z,this.controller=["odeThemeHelperService",p],this.controllerAs="ctrl",this.require=["odeMyApps"]}return e.prototype.link=function(e,t,i,n){var o=n?n[0]:null;o&&((0,a.notif)().onSessionReady().promise.then((function(){o.apps=(0,a.conf)().User.bookmarkedApps,e.$apply()})),e.trackEvent=function(e,t){var i,n;void 0===t.bubbles&&(t.bubbles=!0);var o=null;(t&&"app"===(null===(i=t.detail)||void 0===i?void 0:i.open)||t&&"more"===(null===(n=t.detail)||void 0===n?void 0:n.open))&&(o=new CustomEvent(a.TrackedActionFromWidget.myApps,t)),o&&e.currentTarget&&e.currentTarget.dispatchEvent(o)})},e}();(0,a.notif)().onLangReady().promise.then((function(e){(0,a.conf)().Platform.idiom.addKeys(i(4865))})),t.odeModuleName="odeMyAppsModule",o.default.module(t.odeModuleName,[]).directive("odeMyApps",(function(){return new s}))},4865:e=>{e.exports=JSON.parse('{"my-apps.widget.title":"Mes applis","my-apps.widget.options":"Plus","my-apps.widget.more":"Sélectionner vos applications favorites"}')}}]);
1
+ "use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[649],{5052:(e,t,i)=>{i.d(t,{Z:()=>n});const n='<div class="widget-applications"> <div class="widget-header"> <div class="subtitle"><i18n>my-apps.widget.title</i18n></div> <div class="widget-options"> <div class="widget-handle"><i class="fas fa-grip-vertical"></i></div> </div> </div> <div class="widget-body" dnd-nodrag> <div class="widget-empty-message link" ng-if="ctrl.apps.length===0"> <a href="/welcome" ng-click="trackEvent($event, {detail:{\'open\':\'more\'} })"> <i18n>my-apps.widget.more</i18n> </a> </div> <ul class="icon-grid" ng-if="ctrl.apps.length>0"> <li class="icon-grid-item" ng-repeat="app in ctrl.apps"> <a connector-lightbox-trigger="app" ng-href="[[app.address]]" ng-click="trackEvent($event, {detail:{\'open\':\'app\', \'app\':app} })" aria-label="[[app.displayName]]" target="[[app.target]]" rel="noopener" i18n-title="[[app.displayName]]" ng-switch="app.icon.indexOf(\'/\')"> <i ng-class="ctrl.getIconClass(app)" ng-switch-when="-1"></i> <img skin-src="[[app.icon]]" ng-switch-default alt="[[app.displayName]]"/> </a> </li> </ul> </div> <div class="widget-footer border-top border-ghost" ng-if="ctrl.apps.length!==0"> <div class="widget-footer-action"> <a class="link" href="/welcome" ng-click="trackEvent($event, {detail:{\'open\':\'more\'} })"> <i18n>my-apps.widget.options</i18n> </a> </div> </div> </div>'},1204:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.odeModuleName=void 0;var o=n(i(4202)),a=i(9419),p=function(){function e(e){this.themeSvc=e,this.apps=[]}return e.prototype.redirect=function(e){window.location.href=e},e.prototype.getIconClass=function(e){var t=this.themeSvc.getIconCode(e);return"ic-app-".concat(t," color-app-").concat(t)},e}(),s=function(){function e(){this.restrict="E",this.template=i(5052).Z,this.controller=["odeThemeHelperService",p],this.controllerAs="ctrl",this.require=["odeMyApps"]}return e.prototype.link=function(e,t,i,n){var o=n?n[0]:null;o&&((0,a.notif)().onSessionReady().promise.then(function(){o.apps=(0,a.conf)().User.bookmarkedApps,e.$apply()}),e.trackEvent=function(e,t){var i,n;void 0===t.bubbles&&(t.bubbles=!0);var o=null;(t&&"app"===(null===(i=t.detail)||void 0===i?void 0:i.open)||t&&"more"===(null===(n=t.detail)||void 0===n?void 0:n.open))&&(o=new CustomEvent(a.TrackedActionFromWidget.myApps,t)),o&&e.currentTarget&&e.currentTarget.dispatchEvent(o)})},e}();(0,a.notif)().onLangReady().promise.then(function(e){(0,a.conf)().Platform.idiom.addKeys(i(4865))}),t.odeModuleName="odeMyAppsModule",o.default.module(t.odeModuleName,[]).directive("odeMyApps",function(){return new s})},4865:e=>{e.exports=JSON.parse('{"my-apps.widget.more":"Sélectionner vos applications favorites","my-apps.widget.options":"Plus","my-apps.widget.title":"Mes applis"}')}}]);
2
2
  //# sourceMappingURL=my-apps.widget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"widgets/my-apps/my-apps.widget.js","mappings":"gIAGA,QAFW,uwC,mLCDX,iBAEA,UAIA,aACI,WACKA,GAAA,KAAAA,SAAAA,EAGR,KAAAC,KAAiB,EADd,CAUJ,OARC,YAAAC,SAAA,SAAUC,GACTC,OAAOC,SAASC,KAAOH,CACxB,EAEA,YAAAI,aAAA,SAAaC,GACZ,IAAMC,EAAUC,KAAKV,SAASW,YAAYH,GAC1C,MAAO,iBAAUC,EAAO,sBAAcA,EACvC,EACD,EAdA,GAiBA,0BACI,KAAAG,SAAW,IACd,KAAAC,SAAW,UACX,KAAAC,WAAa,CAAC,wBAAyBC,GACvC,KAAAC,aAAe,OACZ,KAAAC,QAAU,CAAC,YA2Bf,QAzBI,YAAAC,KAAA,SAAKC,EAAoBC,EAAaC,EAAmBC,GACrD,IAAMC,EAAuBD,EAAcA,EAAY,GAAmB,KAC1EC,KAEN,IAAAC,SAAQC,iBAAiBC,QAAQC,MAAM,WACtCJ,EAAKtB,MAAO,IAAA2B,QAAOC,KAAKC,eACxBX,EAAMY,QACP,IAGAZ,EAAMa,WAAa,SAACC,EAASC,G,aAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,MACRF,GAAsB,SAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,OAERJ,GAAsB,UAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,SADzBF,EAAQ,IAAIG,YAAa,EAAAC,wBAAwBC,OAAQP,IAItDE,GAASH,EAAES,eACdT,EAAES,cAAcC,cAAcP,EAEhC,EACD,EACD,EAhCA,IAwCA,IAAAZ,SAAQoB,cAAclB,QAAQC,MAAM,SAAAkB,IAEzB,IAAAjB,QAAOkB,SAASC,MAAMC,QAAS,EAAQ,MAElD,IAIa,EAAAC,cAAgB,kBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,aAd9C,WACC,OAAO,IAAIC,CACZ,G","sources":["webpack://ode-ngjs-front/./src/ts/widgets/my-apps/my-apps.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/my-apps/my-apps.widget.ts"],"sourcesContent":["// Module\nvar code = \"<div class=\\\"widget-applications\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"><i18n>my-apps.widget.title</i18n></div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\"><i class=\\\"fas fa-grip-vertical\\\"></i></div> </div> </div> <div class=\\\"widget-body\\\" dnd-nodrag> <div class=\\\"widget-empty-message link\\\" ng-if=\\\"ctrl.apps.length===0\\\"> <a href=\\\"/welcome\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'more'} })\\\"> <i18n>my-apps.widget.more</i18n> </a> </div> <ul class=\\\"icon-grid\\\" ng-if=\\\"ctrl.apps.length>0\\\"> <li class=\\\"icon-grid-item\\\" ng-repeat=\\\"app in ctrl.apps\\\"> <a connector-lightbox-trigger=\\\"app\\\" ng-href=\\\"[[app.address]]\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'app', 'app':app} })\\\" aria-label=\\\"[[app.displayName]]\\\" target=\\\"[[app.target]]\\\" rel=\\\"noopener\\\" i18n-title=\\\"[[app.displayName]]\\\" ng-switch=\\\"app.icon.indexOf('/')\\\"> <i ng-class=\\\"ctrl.getIconClass(app)\\\" ng-switch-when=\\\"-1\\\"></i> <img skin-src=\\\"[[app.icon]]\\\" ng-switch-default alt=\\\"[[app.displayName]]\\\"/> </a> </li> </ul> </div> <div class=\\\"widget-footer border-top border-ghost\\\" ng-if=\\\"ctrl.apps.length!==0\\\"> <div class=\\\"widget-footer-action\\\"> <a class=\\\"link\\\" href=\\\"/welcome\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'more'} })\\\"> <i18n>my-apps.widget.options</i18n> </a> </div> </div> </div>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective } from \"angular\";\nimport { IWebApp } from \"ode-ts-client\";\nimport { conf, notif, TrackedScope, TrackedAction, TrackedActionFromWidget } from \"../../utils\";\nimport { ThemeHelperService } from \"../../services\";\n\n/* Controller for the directive */\nclass Controller implements IController {\n constructor(\n\t\tpublic themeSvc: ThemeHelperService\n\t\t) {\n }\n\tapps:IWebApp[] = [];\n\tredirect( path:string ) {\n\t\twindow.location.href = path;\n\t};\n\n\tgetIconClass(app:IWebApp) {\n\t\tconst appCode = this.themeSvc.getIconCode(app);\n\t\treturn `ic-app-${appCode} color-app-${appCode}`;\n\t}\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./my-apps.widget.html').default;\n\tcontroller = [\"odeThemeHelperService\", Controller];\n\tcontrollerAs = 'ctrl';\n require = ['odeMyApps'];\n\n link(scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]): void {\n const ctrl:Controller|null = controllers ? controllers[0] as Controller : null;\n\t\tif( ! ctrl ) return;\n\n\t\tnotif().onSessionReady().promise.then( () => {\n\t\t\tctrl.apps = conf().User.bookmarkedApps;\n\t\t\tscope.$apply();\n\t\t});\n\n\t\t// Give an opportunity to track some events from outside of this widget.\n\t\tscope.trackEvent = (e:Event, p:CustomEventInit<TrackedAction>) => {\n\t\t\t// Allow events to bubble up.\n\t\t\tif(typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n\t\t\tlet event = null;\n\t\t\tif( p && p.detail?.open==='app' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.myApps, p );\n\t\t\t} else if( p && p.detail?.open==='more' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.myApps, p );\n\t\t\t}\n\t\t\tif( event && e.currentTarget ) {\n\t\t\t\te.currentTarget.dispatchEvent(event);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** The my-apps widget. */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then( lang => {\n\tswitch( lang ) {\n\t\tdefault:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n\t}\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeMyAppsModule\";\nangular.module( odeModuleName, []).directive( \"odeMyApps\", DirectiveFactory );\n"],"names":["themeSvc","apps","redirect","path","window","location","href","getIconClass","app","appCode","this","getIconCode","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","notif","onSessionReady","promise","then","conf","User","bookmarkedApps","$apply","trackEvent","e","p","bubbles","event","detail","open","CustomEvent","TrackedActionFromWidget","myApps","currentTarget","dispatchEvent","onLangReady","lang","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
1
+ {"version":3,"file":"widgets/my-apps/my-apps.widget.js","mappings":"gIAGA,QAFW,uwC,mLCDX,iBAEA,UAIA,aACI,WACKA,GAAA,KAAAA,SAAAA,EAGR,KAAAC,KAAiB,EADd,CAUJ,OARC,YAAAC,SAAA,SAAUC,GACTC,OAAOC,SAASC,KAAOH,CACxB,EAEA,YAAAI,aAAA,SAAaC,GACZ,IAAMC,EAAUC,KAAKV,SAASW,YAAYH,GAC1C,MAAO,iBAAUC,EAAO,sBAAcA,EACvC,EACD,EAdA,GAiBA,0BACI,KAAAG,SAAW,IACd,KAAAC,SAAW,UACX,KAAAC,WAAa,CAAC,wBAAyBC,GACvC,KAAAC,aAAe,OACZ,KAAAC,QAAU,CAAC,YA2Bf,QAzBI,YAAAC,KAAA,SAAKC,EAAoBC,EAAaC,EAAmBC,GACrD,IAAMC,EAAuBD,EAAcA,EAAY,GAAmB,KAC1EC,KAEN,IAAAC,SAAQC,iBAAiBC,QAAQC,KAAM,WACtCJ,EAAKtB,MAAO,IAAA2B,QAAOC,KAAKC,eACxBX,EAAMY,QACP,GAGAZ,EAAMa,WAAa,SAACC,EAASC,G,aAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,MACRF,GAAsB,SAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,OAERJ,GAAsB,UAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,SADzBF,EAAQ,IAAIG,YAAa,EAAAC,wBAAwBC,OAAQP,IAItDE,GAASH,EAAES,eACdT,EAAES,cAAcC,cAAcP,EAEhC,EACD,EACD,EAhCA,IAwCA,IAAAZ,SAAQoB,cAAclB,QAAQC,KAAM,SAAAkB,IAEzB,IAAAjB,QAAOkB,SAASC,MAAMC,QAAS,EAAQ,MAElD,GAIa,EAAAC,cAAgB,kBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,YAd9C,WACC,OAAO,IAAIC,CACZ,E","sources":["webpack://ode-ngjs-front/./src/ts/widgets/my-apps/my-apps.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/my-apps/my-apps.widget.ts"],"sourcesContent":["// Module\nvar code = \"<div class=\\\"widget-applications\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"><i18n>my-apps.widget.title</i18n></div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\"><i class=\\\"fas fa-grip-vertical\\\"></i></div> </div> </div> <div class=\\\"widget-body\\\" dnd-nodrag> <div class=\\\"widget-empty-message link\\\" ng-if=\\\"ctrl.apps.length===0\\\"> <a href=\\\"/welcome\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'more'} })\\\"> <i18n>my-apps.widget.more</i18n> </a> </div> <ul class=\\\"icon-grid\\\" ng-if=\\\"ctrl.apps.length>0\\\"> <li class=\\\"icon-grid-item\\\" ng-repeat=\\\"app in ctrl.apps\\\"> <a connector-lightbox-trigger=\\\"app\\\" ng-href=\\\"[[app.address]]\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'app', 'app':app} })\\\" aria-label=\\\"[[app.displayName]]\\\" target=\\\"[[app.target]]\\\" rel=\\\"noopener\\\" i18n-title=\\\"[[app.displayName]]\\\" ng-switch=\\\"app.icon.indexOf('/')\\\"> <i ng-class=\\\"ctrl.getIconClass(app)\\\" ng-switch-when=\\\"-1\\\"></i> <img skin-src=\\\"[[app.icon]]\\\" ng-switch-default alt=\\\"[[app.displayName]]\\\"/> </a> </li> </ul> </div> <div class=\\\"widget-footer border-top border-ghost\\\" ng-if=\\\"ctrl.apps.length!==0\\\"> <div class=\\\"widget-footer-action\\\"> <a class=\\\"link\\\" href=\\\"/welcome\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'more'} })\\\"> <i18n>my-apps.widget.options</i18n> </a> </div> </div> </div>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective } from \"angular\";\nimport { IWebApp } from \"ode-ts-client\";\nimport { conf, notif, TrackedScope, TrackedAction, TrackedActionFromWidget } from \"../../utils\";\nimport { ThemeHelperService } from \"../../services\";\n\n/* Controller for the directive */\nclass Controller implements IController {\n constructor(\n\t\tpublic themeSvc: ThemeHelperService\n\t\t) {\n }\n\tapps:IWebApp[] = [];\n\tredirect( path:string ) {\n\t\twindow.location.href = path;\n\t};\n\n\tgetIconClass(app:IWebApp) {\n\t\tconst appCode = this.themeSvc.getIconCode(app);\n\t\treturn `ic-app-${appCode} color-app-${appCode}`;\n\t}\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./my-apps.widget.html').default;\n\tcontroller = [\"odeThemeHelperService\", Controller];\n\tcontrollerAs = 'ctrl';\n require = ['odeMyApps'];\n\n link(scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]): void {\n const ctrl:Controller|null = controllers ? controllers[0] as Controller : null;\n\t\tif( ! ctrl ) return;\n\n\t\tnotif().onSessionReady().promise.then( () => {\n\t\t\tctrl.apps = conf().User.bookmarkedApps;\n\t\t\tscope.$apply();\n\t\t});\n\n\t\t// Give an opportunity to track some events from outside of this widget.\n\t\tscope.trackEvent = (e:Event, p:CustomEventInit<TrackedAction>) => {\n\t\t\t// Allow events to bubble up.\n\t\t\tif(typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n\t\t\tlet event = null;\n\t\t\tif( p && p.detail?.open==='app' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.myApps, p );\n\t\t\t} else if( p && p.detail?.open==='more' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.myApps, p );\n\t\t\t}\n\t\t\tif( event && e.currentTarget ) {\n\t\t\t\te.currentTarget.dispatchEvent(event);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** The my-apps widget. */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then( lang => {\n\tswitch( lang ) {\n\t\tdefault:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n\t}\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeMyAppsModule\";\nangular.module( odeModuleName, []).directive( \"odeMyApps\", DirectiveFactory );\n"],"names":["themeSvc","apps","redirect","path","window","location","href","getIconClass","app","appCode","this","getIconCode","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","notif","onSessionReady","promise","then","conf","User","bookmarkedApps","$apply","trackEvent","e","p","bubbles","event","detail","open","CustomEvent","TrackedActionFromWidget","myApps","currentTarget","dispatchEvent","onLangReady","lang","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}