ode-ngjs-front 1.4.11 → 1.4.12-develop-b2school.202506231606
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.
- package/dist/669.js +2 -0
- package/dist/669.js.map +1 -0
- package/dist/ode-ngjs-front.js +4 -4
- package/dist/ode-ngjs-front.js.map +1 -1
- package/dist/ts/directives/business/portal/navbar.directive.d.ts.map +1 -1
- package/dist/ts/widgets/cantine-widget/cantine-widget.widget.d.ts.map +1 -1
- package/dist/version.txt +1 -1
- package/dist/widgets/agenda-widget/agenda-widget.widget.js +1 -1
- package/dist/widgets/agenda-widget/agenda-widget.widget.js.map +1 -1
- package/dist/widgets/bookmark-widget/bookmark-widget.widget.js +1 -1
- package/dist/widgets/bookmark-widget/bookmark-widget.widget.js.map +1 -1
- package/dist/widgets/briefme-widget/briefme-widget.widget.js +1 -1
- package/dist/widgets/briefme-widget/briefme-widget.widget.js.map +1 -1
- package/dist/widgets/calendar-widget/calendar-widget.widget.js +1 -1
- package/dist/widgets/calendar-widget/calendar-widget.widget.js.map +1 -1
- package/dist/widgets/cantine-widget/cantine-widget.widget.js +1 -1
- package/dist/widgets/cantine-widget/cantine-widget.widget.js.map +1 -1
- package/dist/widgets/carnet-de-bord/carnet-de-bord.widget.js +1 -1
- package/dist/widgets/carnet-de-bord/carnet-de-bord.widget.js.map +1 -1
- package/dist/widgets/cursus-widget/cursus-widget.widget.js +1 -1
- package/dist/widgets/cursus-widget/cursus-widget.widget.js.map +1 -1
- package/dist/widgets/dicodelazone-widget/dicodelazone-widget.widget.js +1 -1
- package/dist/widgets/dicodelazone-widget/dicodelazone-widget.widget.js.map +1 -1
- package/dist/widgets/edumalin-widget/edumalin-widget.widget.js +1 -1
- package/dist/widgets/edumalin-widget/edumalin-widget.widget.js.map +1 -1
- package/dist/widgets/last-infos-widget/last-infos-widget.widget.js +1 -1
- package/dist/widgets/last-infos-widget/last-infos-widget.widget.js.map +1 -1
- package/dist/widgets/maxicours-widget/maxicours-widget.widget.js +1 -1
- package/dist/widgets/maxicours-widget/maxicours-widget.widget.js.map +1 -1
- package/dist/widgets/mediacentre-widget/mediacentre-widget.widget.js +1 -1
- package/dist/widgets/mediacentre-widget/mediacentre-widget.widget.js.map +1 -1
- package/dist/widgets/my-apps/my-apps.widget.js +1 -1
- package/dist/widgets/my-apps/my-apps.widget.js.map +1 -1
- package/dist/widgets/qwant-widget/qwant-widget.widget.js +1 -1
- package/dist/widgets/qwant-widget/qwant-widget.widget.js.map +1 -1
- package/dist/widgets/record-me/record-me.widget.js +1 -1
- package/dist/widgets/record-me/record-me.widget.js.map +1 -1
- package/dist/widgets/rss-widget/rss-widget.widget.js +1 -1
- package/dist/widgets/rss-widget/rss-widget.widget.js.map +1 -1
- package/dist/widgets/school-widget/school-widget.widget.js +1 -1
- package/dist/widgets/school-widget/school-widget.widget.js.map +1 -1
- package/dist/widgets/universalis-widget/universalis-widget.widget.js +1 -1
- package/dist/widgets/universalis-widget/universalis-widget.widget.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets/mediacentre-widget/mediacentre-widget.widget.js","mappings":"gIAGA,QAFW,+9I,8iDCDX,iBACA,UACA,UAqCA,qCACY,KAAAA,UAAwB,GACxB,KAAAC,eAAyB,EAC1B,KAAAC,gBAA0B,EAE1B,KAAAC,cAAgB,gD,kDACnB,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,YAG3F,KAAAS,eAAiB,SAAOC,GAAc,qC,4DAEb,O,sBAAA,IAAM,IAAAC,QAAOC,IAAcF,I,aAC3B,QADrBG,EAAqB,UACZC,QAAoBD,GAAYA,EAASE,MAAQF,EAASE,KAAKR,OAAS,IAC7ES,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AAKmB,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,gGAE5D,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,YAIR,EAjCA,GAoCA,SAASQ,EAAiB3B,GACtB,OAAO,IAAI4B,EAAU5B,EACzB,CACA2B,EAAiBE,QAAU,CAAC,aAG5B,IAAA1C,SAAQ2C,cAAczC,QAAQ0C,MAAK,SAACC,IAEnB,IAAAC,QAAOC,SAASC,MAAMC,QAAS,EAAQ,MAExD,IAIa,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
|
+
{"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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AMW,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(
|
|
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"}')}}]);
|
|
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,
|
|
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":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[165],{8265:(t,e,n)=>{n.d(e,{Z:()=>a});const a=' <style>.widget-qwant .widget-header{border:0}.widget-qwant .widget-body img{margin:auto}</style> <div class="widget-qwant"> <div class="widget-header"> <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"> <div class="row row-cols-1 align-items-center"> <div class="mb-12"> <a href="https://www.qwant.com" target="_blank" rel="noopener" ng-click="trackEvent($event, {detail:{\'open\':\'qwant\'} })"> <img src="/assets/widgets/qwant/logo-qwant.svg" width="77" height="75" alt="Qwant"> </a> </div> </div> <form method="GET" target="_blank" action="https://www.qwant.com" autocomplete="off"> <div class="row row-cols-1 align-items-center"> <label class="sr-only" for="inputQwantQ" translate content="search"></label> <div class="input-group mb-2"> <input type="text" id="inputQwantQ" class="form-control" name="q" maxlength="255" i18n-placeholder="search"/> <input type="hidden" name="l" value="fr"/> <button class="btn btn-outline-secondary" aria-labelledby="inputQwantQ" ng-click="trackEvent($event, {detail:{\'search\':\'launch\'} })"> <i class="ic-search"></i> </button> </div> </div> </form> </div> </div> </div>'},3399:function(t,e,n){var a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.odeModuleName=void 0;var i=a(n(4202)),o=n(9419),d=function(){function t(){this.restrict="E",this.template=n(8265).Z}return t.prototype.link=function(t){t.trackEvent=function(t,e){var n,a;void 0===e.bubbles&&(e.bubbles=!0);var i=null;!e||"qwant"!==(null===(n=e.detail)||void 0===n?void 0:n.open)&&"string"!=typeof(null===(a=e.detail)||void 0===a?void 0:a.search)||(i=new CustomEvent(o.TrackedActionFromWidget.qwant,e)),i&&t.currentTarget&&t.currentTarget.dispatchEvent(i)}},t}();(0,o.notif)().onLangReady().promise.then(
|
|
1
|
+
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[165],{8265:(t,e,n)=>{n.d(e,{Z:()=>a});const a=' <style>.widget-qwant .widget-header{border:0}.widget-qwant .widget-body img{margin:auto}</style> <div class="widget-qwant"> <div class="widget-header"> <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"> <div class="row row-cols-1 align-items-center"> <div class="mb-12"> <a href="https://www.qwant.com" target="_blank" rel="noopener" ng-click="trackEvent($event, {detail:{\'open\':\'qwant\'} })"> <img src="/assets/widgets/qwant/logo-qwant.svg" width="77" height="75" alt="Qwant"> </a> </div> </div> <form method="GET" target="_blank" action="https://www.qwant.com" autocomplete="off"> <div class="row row-cols-1 align-items-center"> <label class="sr-only" for="inputQwantQ" translate content="search"></label> <div class="input-group mb-2"> <input type="text" id="inputQwantQ" class="form-control" name="q" maxlength="255" i18n-placeholder="search"/> <input type="hidden" name="l" value="fr"/> <button class="btn btn-outline-secondary" aria-labelledby="inputQwantQ" ng-click="trackEvent($event, {detail:{\'search\':\'launch\'} })"> <i class="ic-search"></i> </button> </div> </div> </form> </div> </div> </div>'},3399:function(t,e,n){var a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.odeModuleName=void 0;var i=a(n(4202)),o=n(9419),d=function(){function t(){this.restrict="E",this.template=n(8265).Z}return t.prototype.link=function(t){t.trackEvent=function(t,e){var n,a;void 0===e.bubbles&&(e.bubbles=!0);var i=null;!e||"qwant"!==(null===(n=e.detail)||void 0===n?void 0:n.open)&&"string"!=typeof(null===(a=e.detail)||void 0===a?void 0:a.search)||(i=new CustomEvent(o.TrackedActionFromWidget.qwant,e)),i&&t.currentTarget&&t.currentTarget.dispatchEvent(i)}},t}();(0,o.notif)().onLangReady().promise.then(function(t){(0,o.conf)().Platform.idiom.addKeys(n(2467))}),e.odeModuleName="odeQwantModule",i.default.module(e.odeModuleName,[]).directive("odeQwant",function(){return new d})},2467:t=>{t.exports=JSON.parse('{"qwant-widget.widget.title":"Qwant","qwant-junior":"QwantJunior","qwant":"Qwant"}')}}]);
|
|
2
2
|
//# sourceMappingURL=qwant-widget.widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets/qwant-widget/qwant-widget.widget.js","mappings":"gIAGA,QAFW,guC,mLCDX,iBACA,UAGA,0BACI,KAAAA,SAAW,IACd,KAAAC,SAAW,SAiBZ,QAfC,YAAAC,KAAA,SAAKC,GAEJA,EAAMC,WAAa,SAACC,EAASC,G,aAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,MACRF,GAAuB,WAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,OAA4C,iBAAX,QAAR,EAAAJ,EAAEG,cAAM,eAAEE,UACtDH,EAAQ,IAAII,YAAa,EAAAC,wBAAwBC,MAAOR,IAErDE,GAASH,EAAEU,eACdV,EAAEU,cAAcC,cAAcR,EAEhC,CACD,EACD,EAnBA,IA2BA,IAAAS,SAAQC,cAAcC,QAAQC,
|
|
1
|
+
{"version":3,"file":"widgets/qwant-widget/qwant-widget.widget.js","mappings":"gIAGA,QAFW,guC,mLCDX,iBACA,UAGA,0BACI,KAAAA,SAAW,IACd,KAAAC,SAAW,SAiBZ,QAfC,YAAAC,KAAA,SAAKC,GAEJA,EAAMC,WAAa,SAACC,EAASC,G,aAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,MACRF,GAAuB,WAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,OAA4C,iBAAX,QAAR,EAAAJ,EAAEG,cAAM,eAAEE,UACtDH,EAAQ,IAAII,YAAa,EAAAC,wBAAwBC,MAAOR,IAErDE,GAASH,EAAEU,eACdV,EAAEU,cAAcC,cAAcR,EAEhC,CACD,EACD,EAnBA,IA2BA,IAAAS,SAAQC,cAAcC,QAAQC,KAAM,SAAAC,IAEzB,IAAAC,QAAOC,SAASC,MAAMC,QAAS,EAAQ,MAElD,GAIa,EAAAC,cAAgB,iBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,WAd9C,WACC,OAAO,IAAIC,CACZ,E","sources":["webpack://ode-ngjs-front/./src/ts/widgets/qwant-widget/qwant-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/qwant-widget/qwant-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \" <style>.widget-qwant .widget-header{border:0}.widget-qwant .widget-body img{margin:auto}</style> <div class=\\\"widget-qwant\\\"> <div class=\\\"widget-header\\\"> <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\\\"> <div class=\\\"row row-cols-1 align-items-center\\\"> <div class=\\\"mb-12\\\"> <a href=\\\"https://www.qwant.com\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'qwant'} })\\\"> <img src=\\\"/assets/widgets/qwant/logo-qwant.svg\\\" width=\\\"77\\\" height=\\\"75\\\" alt=\\\"Qwant\\\"> </a> </div> </div> <form method=\\\"GET\\\" target=\\\"_blank\\\" action=\\\"https://www.qwant.com\\\" autocomplete=\\\"off\\\"> <div class=\\\"row row-cols-1 align-items-center\\\"> <label class=\\\"sr-only\\\" for=\\\"inputQwantQ\\\" translate content=\\\"search\\\"></label> <div class=\\\"input-group mb-2\\\"> <input type=\\\"text\\\" id=\\\"inputQwantQ\\\" class=\\\"form-control\\\" name=\\\"q\\\" maxlength=\\\"255\\\" i18n-placeholder=\\\"search\\\"/> <input type=\\\"hidden\\\" name=\\\"l\\\" value=\\\"fr\\\"/> <button class=\\\"btn btn-outline-secondary\\\" aria-labelledby=\\\"inputQwantQ\\\" ng-click=\\\"trackEvent($event, {detail:{'search':'launch'} })\\\"> <i class=\\\"ic-search\\\"></i> </button> </div> </div> </form> </div> </div> </div>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { conf, notif, TrackedAction, TrackedScope, TrackedActionFromWidget } from \"../../utils\";\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./qwant-widget.widget.html').default;\n\n\tlink(scope:TrackedScope) {\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==='qwant' || typeof p.detail?.search==='string') ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.qwant, 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 qwant 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 = \"odeQwantModule\";\nangular.module( odeModuleName, []).directive( \"odeQwant\", DirectiveFactory );\n"],"names":["restrict","template","link","scope","trackEvent","e","p","bubbles","event","detail","open","search","CustomEvent","TrackedActionFromWidget","qwant","currentTarget","dispatchEvent","notif","onLangReady","promise","then","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([[932],{7072:(e,d,i)=>{i.d(d,{Z:()=>t});const t=' <div class="widget-record"> <div class="widget-header"> <div class="subtitle"><i18n>record-me.widget.title</i18n></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 flex-wrap justify-content-center" ode-recorder dnd-nodrag></div> </div> '},1317:function(e,d,i){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d,"__esModule",{value:!0}),d.odeModuleName=void 0;var o=t(i(4202)),r=i(9419),s=function(){this.restrict="E",this.template=i(7072).Z};(0,r.notif)().onLangReady().promise.then(
|
|
1
|
+
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[932],{7072:(e,d,i)=>{i.d(d,{Z:()=>t});const t=' <div class="widget-record"> <div class="widget-header"> <div class="subtitle"><i18n>record-me.widget.title</i18n></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 flex-wrap justify-content-center" ode-recorder dnd-nodrag></div> </div> '},1317:function(e,d,i){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d,"__esModule",{value:!0}),d.odeModuleName=void 0;var o=t(i(4202)),r=i(9419),s=function(){this.restrict="E",this.template=i(7072).Z};(0,r.notif)().onLangReady().promise.then(function(e){(0,r.conf)().Platform.idiom.addKeys(i(6299))}),d.odeModuleName="odeRecordMeModule",o.default.module(d.odeModuleName,[]).directive("odeRecordMe",function(){return new s})},6299:e=>{e.exports=JSON.parse('{"record-me.widget.title":"Le studio"}')}}]);
|
|
2
2
|
//# sourceMappingURL=record-me.widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets/record-me/record-me.widget.js","mappings":"gIAGA,QAFW,0X,mLCDX,iBACA,UAGA,aACI,KAAAA,SAAW,IACd,KAAAC,SAAW,SACZ,GAQA,IAAAC,SAAQC,cAAcC,QAAQC,
|
|
1
|
+
{"version":3,"file":"widgets/record-me/record-me.widget.js","mappings":"gIAGA,QAFW,0X,mLCDX,iBACA,UAGA,aACI,KAAAA,SAAW,IACd,KAAAC,SAAW,SACZ,GAQA,IAAAC,SAAQC,cAAcC,QAAQC,KAAM,SAAAC,IAEzB,IAAAC,QAAOC,SAASC,MAAMC,QAAS,EAAQ,MAElD,GAIa,EAAAC,cAAgB,oBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,cAd9C,WACC,OAAO,IAAIC,CACZ,E","sources":["webpack://ode-ngjs-front/./src/ts/widgets/record-me/record-me.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/record-me/record-me.widget.ts"],"sourcesContent":["// Module\nvar code = \" <div class=\\\"widget-record\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"><i18n>record-me.widget.title</i18n></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 flex-wrap justify-content-center\\\" ode-recorder dnd-nodrag></div> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { conf, notif } from \"../../utils\";\n\n/* Directive */\nclass Directive implements IDirective<IScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./record-me.widget.html').default;\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 = \"odeRecordMeModule\";\nangular.module( odeModuleName, []).directive( \"odeRecordMe\", DirectiveFactory );\n"],"names":["restrict","template","notif","onLangReady","promise","then","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([[390],{4643:(e,t,i)=>{i.d(t,{Z:()=>n});const n=' <div class="widget-rss"> <div class="widget-header"> <div class="subtitle"><i18n>rss-widget.widget.title</i18n></div> <div class="widget-options"> <div class="tools"> <a href="#" class="tool tool-option" i18n-title="rss-widget.widget.channel.config" ng-if="ctrl.canAddFeed" ng-click="ctrl.display.edition = true"> <i class="fas fa-cog"></i> </a> </div> <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 link" ng-click="ctrl.display.edition = true" ng-if="ctrl.channel===undefined || ctrl.channel.feeds.length === 0"> <i18n>rss-widget.widget.empty.info</i18n> </div> <div class="widget-empty-message link" ng-if="ctrl.channel && ctrl.channel.feeds.length > 0 && ctrl.feeds.length === 0"> <i18n>rss-widget.widget.channel.feed.no.result</i18n> </div> <div class="rss-feed" ng-if="ctrl.feeds !== undefined" ng-repeat="feed in ctrl.feeds track by $index"> <div class="feed-title" ng-click="ctrl.showOrHideFeed($index)">[[feed.title]]</div> <ul class="list" ng-show="ctrl.display.selectedFeed === [[$index]]"> <li class="item link" ng-repeat="item in feed.Items track by $index"> <a href="[[item.link]]" target="_blank" rel="noopener" ng-click="trackEvent($event, {detail:{\'open\':item.link} })"> <div class="title">[[item.title]]</div> <div class="meta">[[ctrl.formatDate(item.pubDate)]]</div> <div class="meta" ng-bind-html="item.description"></div> </a> </li> </ul> </div> </div> </div> <ode-modal visible="ctrl.display.edition" on-close="ctrl.display.edition = false" dnd-nodrag> <ode-modal-title> <i18n ng-if="!ctrl.display.feedEdition">rss-widget.widget.channel.feed.list</i18n> <i18n ng-if="ctrl.display.feedEdition">rss-widget.widget.channel.feed.edit</i18n> </ode-modal-title> <ode-modal-body> <div ng-if="!ctrl.display.feedEdition"> <p ng-if="ctrl.channel.feeds.length === 0"><i18n>rss-widget.widget.channel.undefined</i18n></p> <table class="table table-hover" ng-if="ctrl.channel.feeds.length > 0"> <thead> <tr class="bg-secondary text-light"> <th><i18n>rss-widget.widget.channel.feed.title</i18n></th> <th><i18n>rss-widget.widget.channel.feed.show</i18n></th> <th></th> </tr> </thead> <tbody> <tr class="c-pointer" ng-repeat="feed in ctrl.channel.feeds track by $index" ng-class="{ \'table-active\' : ctrl.display.feedEdition && $index === ctrl.selectedFeedIndex }"> <td ng-click="ctrl.openFeedEdition($index)">[[ctrl.channel.feeds[$index].title]]</td> <td ng-click="ctrl.openFeedEdition($index)">[[ctrl.channel.feeds[$index].show]]</td> <td ng-click="ctrl.removeFeed($index)"> <button type="button" class="btn-close" aria-label="Close"></button> </td> </tr> </tbody> </table> </div> <form autocomplete="off" id="formFeedEdition" ng-if="ctrl.display.feedEdition"> <div class="form-group row"> <label for="inputFeedTitle" class="col-sm-4 col-form-label"><i18n>rss-widget.widget.channel.feed.title</i18n></label> <div class="col-sm-8"> <input type="text" i18n-placeholder="rss-widget.widget.channel.feed.title.placeholder" id="inputFeedTitle" class="form-control" ng-model="ctrl.selectedFeed.title"/> </div> </div> <div class="form-group row mt-3"> <label for="inputFeedUrl" class="col-sm-4 col-form-label"><i18n>rss-widget.widget.channel.feed.url</i18n></label> <div class="col-sm-8"> <input type="text" i18n-placeholder="rss-widget.widget.channel.feed.url.placeholder" id="inputFeedUrl" class="form-control" ng-model="ctrl.selectedFeed.link"/> </div> </div> <div class="form-group row mt-3"> <label for="inputFeedShow" class="col-sm-4 col-form-label"><i18n>rss-widget.widget.channel.feed.show</i18n></label> <div class="col-sm-8"> <select id="inputFeedShow" class="form-control" ng-options="n for n in ctrl.showValues" ng-model="ctrl.selectedFeed.show"></select> </div> </div> </form> </ode-modal-body> <ode-modal-footer> <div ng-if="!ctrl.display.feedEdition && ctrl.canAddFeed"> <button class="btn btn-primary" ng-click="ctrl.openFeedEdition()" translate content="rss-widget.widget.channel.feed.add"></button> </div> <div ng-if="ctrl.display.feedEdition"> <button form="formFeedEdition" type="reset" class="btn btn-light" ng-click="ctrl.closeFeedEdition()"> <i18n>rss-widget.widget.channel.feed.cancel</i18n> </button> <button form="formFeedEdition" type="submit" class="btn btn-primary" ng-click="ctrl.saveFeed()"> <i18n>rss-widget.widget.channel.feed.save</i18n> </button> </div> </ode-modal-footer> </ode-modal>'},7377: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 d=n(i(4202)),l=i(9419),s=function(){function e(){this.channel=void 0,this.feeds=[],this.totalFeeds=10,this.defaultShow=3,this.showValues=[1,2,3,4,5,6,7,8,9,10],this.display={edition:!1,feedEdition:!1,selectedFeed:0}}return e.prototype.initFeeds=function(){var e=this;return void 0===this.channel?(0,l.http)().get("/rss/channels").then(
|
|
1
|
+
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[390],{4643:(e,t,i)=>{i.d(t,{Z:()=>n});const n=' <div class="widget-rss"> <div class="widget-header"> <div class="subtitle"><i18n>rss-widget.widget.title</i18n></div> <div class="widget-options"> <div class="tools"> <a href="#" class="tool tool-option" i18n-title="rss-widget.widget.channel.config" ng-if="ctrl.canAddFeed" ng-click="ctrl.display.edition = true"> <i class="fas fa-cog"></i> </a> </div> <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 link" ng-click="ctrl.display.edition = true" ng-if="ctrl.channel===undefined || ctrl.channel.feeds.length === 0"> <i18n>rss-widget.widget.empty.info</i18n> </div> <div class="widget-empty-message link" ng-if="ctrl.channel && ctrl.channel.feeds.length > 0 && ctrl.feeds.length === 0"> <i18n>rss-widget.widget.channel.feed.no.result</i18n> </div> <div class="rss-feed" ng-if="ctrl.feeds !== undefined" ng-repeat="feed in ctrl.feeds track by $index"> <div class="feed-title" ng-click="ctrl.showOrHideFeed($index)">[[feed.title]]</div> <ul class="list" ng-show="ctrl.display.selectedFeed === [[$index]]"> <li class="item link" ng-repeat="item in feed.Items track by $index"> <a href="[[item.link]]" target="_blank" rel="noopener" ng-click="trackEvent($event, {detail:{\'open\':item.link} })"> <div class="title">[[item.title]]</div> <div class="meta">[[ctrl.formatDate(item.pubDate)]]</div> <div class="meta" ng-bind-html="item.description"></div> </a> </li> </ul> </div> </div> </div> <ode-modal visible="ctrl.display.edition" on-close="ctrl.display.edition = false" dnd-nodrag> <ode-modal-title> <i18n ng-if="!ctrl.display.feedEdition">rss-widget.widget.channel.feed.list</i18n> <i18n ng-if="ctrl.display.feedEdition">rss-widget.widget.channel.feed.edit</i18n> </ode-modal-title> <ode-modal-body> <div ng-if="!ctrl.display.feedEdition"> <p ng-if="ctrl.channel.feeds.length === 0"><i18n>rss-widget.widget.channel.undefined</i18n></p> <table class="table table-hover" ng-if="ctrl.channel.feeds.length > 0"> <thead> <tr class="bg-secondary text-light"> <th><i18n>rss-widget.widget.channel.feed.title</i18n></th> <th><i18n>rss-widget.widget.channel.feed.show</i18n></th> <th></th> </tr> </thead> <tbody> <tr class="c-pointer" ng-repeat="feed in ctrl.channel.feeds track by $index" ng-class="{ \'table-active\' : ctrl.display.feedEdition && $index === ctrl.selectedFeedIndex }"> <td ng-click="ctrl.openFeedEdition($index)">[[ctrl.channel.feeds[$index].title]]</td> <td ng-click="ctrl.openFeedEdition($index)">[[ctrl.channel.feeds[$index].show]]</td> <td ng-click="ctrl.removeFeed($index)"> <button type="button" class="btn-close" aria-label="Close"></button> </td> </tr> </tbody> </table> </div> <form autocomplete="off" id="formFeedEdition" ng-if="ctrl.display.feedEdition"> <div class="form-group row"> <label for="inputFeedTitle" class="col-sm-4 col-form-label"><i18n>rss-widget.widget.channel.feed.title</i18n></label> <div class="col-sm-8"> <input type="text" i18n-placeholder="rss-widget.widget.channel.feed.title.placeholder" id="inputFeedTitle" class="form-control" ng-model="ctrl.selectedFeed.title"/> </div> </div> <div class="form-group row mt-3"> <label for="inputFeedUrl" class="col-sm-4 col-form-label"><i18n>rss-widget.widget.channel.feed.url</i18n></label> <div class="col-sm-8"> <input type="text" i18n-placeholder="rss-widget.widget.channel.feed.url.placeholder" id="inputFeedUrl" class="form-control" ng-model="ctrl.selectedFeed.link"/> </div> </div> <div class="form-group row mt-3"> <label for="inputFeedShow" class="col-sm-4 col-form-label"><i18n>rss-widget.widget.channel.feed.show</i18n></label> <div class="col-sm-8"> <select id="inputFeedShow" class="form-control" ng-options="n for n in ctrl.showValues" ng-model="ctrl.selectedFeed.show"></select> </div> </div> </form> </ode-modal-body> <ode-modal-footer> <div ng-if="!ctrl.display.feedEdition && ctrl.canAddFeed"> <button class="btn btn-primary" ng-click="ctrl.openFeedEdition()" translate content="rss-widget.widget.channel.feed.add"></button> </div> <div ng-if="ctrl.display.feedEdition"> <button form="formFeedEdition" type="reset" class="btn btn-light" ng-click="ctrl.closeFeedEdition()"> <i18n>rss-widget.widget.channel.feed.cancel</i18n> </button> <button form="formFeedEdition" type="submit" class="btn btn-primary" ng-click="ctrl.saveFeed()"> <i18n>rss-widget.widget.channel.feed.save</i18n> </button> </div> </ode-modal-footer> </ode-modal>'},7377: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 d=n(i(4202)),l=i(9419),s=function(){function e(){this.channel=void 0,this.feeds=[],this.totalFeeds=10,this.defaultShow=3,this.showValues=[1,2,3,4,5,6,7,8,9,10],this.display={edition:!1,feedEdition:!1,selectedFeed:0}}return e.prototype.initFeeds=function(){var e=this;return void 0===this.channel?(0,l.http)().get("/rss/channels").then(function(t){return t&&t.length>0?e.channel=t[0]:e.channel={feeds:[]},e.loadFeeds(0)}).catch(function(t){console.warn("[widget.rss] failed to initFeeds: ",t),e.channel={feeds:[]}}):this.loadFeeds(0)},e.prototype.loadFeeds=function(e){var t=this;return this.feeds=[],Promise.all(this.channel.feeds.map(function(i){var n=i.title;return null!==i.link&&""!==i.link?(0,l.http)().get("/rss/feed/items?url="+encodeURIComponent(i.link)+"&force="+e).then(function(e){"object"!=typeof e||e.title||(e.title=n),200===e.status&&t.feeds.length<t.totalFeeds&&(void 0!==e.Items&&null!=i.show&&e.Items.length>i.show&&(e.Items=e.Items.slice(0,i.show)),t.feeds.push(e))}).catch(function(e){console.warn("[widget.rss] failed to loadFeeds: ",e)}):Promise.resolve()})).then(function(e){})},Object.defineProperty(e.prototype,"canAddFeed",{get:function(){var e=$(window).width();return this.channel&&this.channel.feeds.length<this.totalFeeds&&("number"!=typeof e||e>=992)},enumerable:!1,configurable:!0}),e.prototype.openFeedEdition=function(e){"number"==typeof e&&e>=0&&e<this.totalFeeds?(this.selectedFeed=d.default.copy(this.channel.feeds[e]),this.selectedFeedIndex=e):(this.selectedFeed={title:"",link:"",show:3},this.selectedFeedIndex=-1),this.display.feedEdition=!0},e.prototype.closeFeedEdition=function(){this.display.feedEdition=!1,this.selectedFeed=void 0,this.selectedFeedIndex=void 0},e.prototype.removeFeed=function(e){"number"==typeof e&&e>=0&&e<this.totalFeeds&&(this.channel.feeds.splice(e,1),this.saveChannel())},e.prototype.validFeed=function(e){return e&&e.title&&""!==e.title.trim()&&e.link&&""!==e.link.trim()},e.prototype.saveFeed=function(){"number"==typeof this.selectedFeedIndex&&this.validFeed(this.selectedFeed)&&this.selectedFeed&&(this.selectedFeedIndex>=0&&this.selectedFeedIndex<this.totalFeeds?this.channel.feeds[this.selectedFeedIndex]=this.selectedFeed:this.channel.feeds.push(this.selectedFeed),this.saveChannel()),this.closeFeedEdition()},e.prototype.saveChannel=function(){this.channel._id?this.editChannel():this.createChannel()},e.prototype.createChannel=function(){var e=this;this.channel?(0,l.http)().postJson("/rss/channel",this.channel).then(function(t){e.channel._id=t._id,e.loadFeeds(0)}):console.log("createChannel : channel is undefined")},e.prototype.editChannel=function(){var e=this;this.channel&&this.channel._id?(0,l.http)().putJson("/rss/channel/"+this.channel._id,{feeds:this.channel.feeds}).then(function(t){e.loadFeeds(0)}):console.log("editChannel : channel is undefined")},e.prototype.showOrHideFeed=function(e){this.display.selectedFeed===e?this.display.selectedFeed=void 0:this.display.selectedFeed=e},e.prototype.formatDate=function(e){return("number"==typeof e?l.L10n.unix(e):l.L10n.moment(e,void 0,"en")).locale("fr").format("dddd DD MMMM YYYY HH:mm")},e}(),o=function(){function e(){this.restrict="E",this.template=i(4643).Z,this.controller=[s],this.controllerAs="ctrl",this.require=["odeRssWidget"]}return e.prototype.link=function(e,t,i,n){var d=n?n[0]:null;d&&(d.initFeeds().then(function(){e.$apply()}),e.trackEvent=function(e,t){var i;void 0===t.bubbles&&(t.bubbles=!0);var n=null;t&&"string"==typeof(null===(i=t.detail)||void 0===i?void 0:i.open)&&(n=new CustomEvent(l.TrackedActionFromWidget.rss,t)),n&&e.currentTarget&&e.currentTarget.dispatchEvent(n)})},e}();(0,l.notif)().onLangReady().promise.then(function(e){(0,l.conf)().Platform.idiom.addKeys(i(2546))}),t.odeModuleName="odeRssWidgetModule",d.default.module(t.odeModuleName,[]).directive("odeRssWidget",function(){return new o})},2546:e=>{e.exports=JSON.parse('{"rss-widget.widget.title":"RSS","rss-widget.widget.channel.config":"Configurer","rss-widget.widget.channel.feed.add":"Ajouter un flux","rss-widget.widget.channel.feed.cancel":"Retour","rss-widget.widget.channel.feed.edit":"Edition d\'un flux","rss-widget.widget.channel.feed.list":"Liste des flux","rss-widget.widget.channel.feed.no.result":"Aucun résultat","rss-widget.widget.channel.feed.read.more":"Voir plus","rss-widget.widget.channel.feed.remove":"Supprimer le flux","rss-widget.widget.channel.feed.save":"Enregistrer","rss-widget.widget.channel.feed.show":"Nombre d\'articles à afficher","rss-widget.widget.channel.feed.title":"Titre","rss-widget.widget.channel.feed.update":"Actualiser","rss-widget.widget.channel.feed.url":"Adresse du flux","rss-widget.widget.channel.refresh":"Rafraîchir","rss-widget.widget.channel.undefined":"Aucun flux configuré","rss-widget.widget.channel.feed.title.placeholder":"Saisissez le titre du nouveau flux RSS","rss-widget.widget.channel.feed.url.placeholder":"Saisissez l\'Url du nouveau flux RSS","rss-widget.widget.empty.info":"Ajoutez un flux RSS pour voir vos derniers articles"}')}}]);
|
|
2
2
|
//# sourceMappingURL=rss-widget.widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets/rss-widget/rss-widget.widget.js","mappings":"gIAGA,QAFW,63I,mLCDX,iBACA,UA8BA,0BACC,KAAAA,aAAkBC,EAClB,KAAAC,MAAe,GAGf,KAAAC,WAAa,GACb,KAAAC,YAAc,EACd,KAAAC,WAAa,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAChC,KAAAC,QAII,CACHC,SAAS,EACTC,aAAa,EACbC,aAAc,EAgJhB,QA7IC,YAAAC,UAAA,sBACC,YAAoBT,IAAjBU,KAAKX,SACA,IAAAY,QAAOC,IAAe,iBAC5BC,MAAM,SAAAC,GAMN,OALGA,GAAYA,EAASC,OAAS,EAChC,EAAKhB,QAAUe,EAAS,GAExB,EAAKf,QAAU,CAACE,MAAM,IAEhB,EAAKe,UAAU,EACvB,IACCC,OAAO,SAAAC,GACPC,QAAQC,KAAK,qCAAsCF,GACnD,EAAKnB,QAAU,CAACE,MAAM,GACvB,I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U,KAAKL,QAAQG,aAAemC,CAE9B,EAEA,YAAAkB,WAAA,SAAYC,GAOX,OALoB,iBAATA,EACG,EAAAC,KAAKC,KAAKF,GAEV,EAAAC,KAAKE,OAAOH,OAAM9D,EAAW,OAEzBkE,OAAO,MAAMC,OAAO,0BACvC,EACD,EA/JA,GAkKA,0BACI,KAAAC,SAAW,IACd,KAAAC,SAAW,UACX,KAAAC,WAAa,CAACC,GACd,KAAAC,aAAe,OACZ,KAAAC,QAAU,CAAC,eAyBf,QAvBI,YAAA7C,KAAA,SAAK8C,EAAoBC,EAAaC,EAAmBC,GACrD,IAAMC,EAAuBD,EAAcA,EAAY,GAAmB,KAC1EC,IAGNA,EAAKrE,YAAYI,MAAM,WACtB6D,EAAMK,QACP,IAGAL,EAAMM,WAAa,SAAC9D,EAAS+D,G,WAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,KACRF,GAA6B,iBAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,QACzBF,EAAQ,IAAIG,YAAa,EAAAC,wBAAwBC,IAAKP,IAEnDE,GAASjE,EAAEuE,eACdvE,EAAEuE,cAAcC,cAAcP,EAEhC,EACD,EACD,EA9BA,IAsCA,IAAAQ,SAAQC,cAAcC,QAAQhF,MAAM,SAAAiF,IAEzB,IAAAC,QAAOC,SAASC,MAAMC,QAAS,EAAQ,MAElD,IAIa,EAAAC,cAAgB,qBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,gBAd9C,WACC,OAAO,IAAIC,CACZ,G","sources":["webpack://ode-ngjs-front/./src/ts/widgets/rss-widget/rss-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/rss-widget/rss-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \" <div class=\\\"widget-rss\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"><i18n>rss-widget.widget.title</i18n></div> <div class=\\\"widget-options\\\"> <div class=\\\"tools\\\"> <a href=\\\"#\\\" class=\\\"tool tool-option\\\" i18n-title=\\\"rss-widget.widget.channel.config\\\" ng-if=\\\"ctrl.canAddFeed\\\" ng-click=\\\"ctrl.display.edition = true\\\"> <i class=\\\"fas fa-cog\\\"></i> </a> </div> <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 link\\\" ng-click=\\\"ctrl.display.edition = true\\\" ng-if=\\\"ctrl.channel===undefined || ctrl.channel.feeds.length === 0\\\"> <i18n>rss-widget.widget.empty.info</i18n> </div> <div class=\\\"widget-empty-message link\\\" ng-if=\\\"ctrl.channel && ctrl.channel.feeds.length > 0 && ctrl.feeds.length === 0\\\"> <i18n>rss-widget.widget.channel.feed.no.result</i18n> </div> <div class=\\\"rss-feed\\\" ng-if=\\\"ctrl.feeds !== undefined\\\" ng-repeat=\\\"feed in ctrl.feeds track by $index\\\"> <div class=\\\"feed-title\\\" ng-click=\\\"ctrl.showOrHideFeed($index)\\\">[[feed.title]]</div> <ul class=\\\"list\\\" ng-show=\\\"ctrl.display.selectedFeed === [[$index]]\\\"> <li class=\\\"item link\\\" ng-repeat=\\\"item in feed.Items track by $index\\\"> <a href=\\\"[[item.link]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" ng-click=\\\"trackEvent($event, {detail:{'open':item.link} })\\\"> <div class=\\\"title\\\">[[item.title]]</div> <div class=\\\"meta\\\">[[ctrl.formatDate(item.pubDate)]]</div> <div class=\\\"meta\\\" ng-bind-html=\\\"item.description\\\"></div> </a> </li> </ul> </div> </div> </div> <ode-modal visible=\\\"ctrl.display.edition\\\" on-close=\\\"ctrl.display.edition = false\\\" dnd-nodrag> <ode-modal-title> <i18n ng-if=\\\"!ctrl.display.feedEdition\\\">rss-widget.widget.channel.feed.list</i18n> <i18n ng-if=\\\"ctrl.display.feedEdition\\\">rss-widget.widget.channel.feed.edit</i18n> </ode-modal-title> <ode-modal-body> <div ng-if=\\\"!ctrl.display.feedEdition\\\"> <p ng-if=\\\"ctrl.channel.feeds.length === 0\\\"><i18n>rss-widget.widget.channel.undefined</i18n></p> <table class=\\\"table table-hover\\\" ng-if=\\\"ctrl.channel.feeds.length > 0\\\"> <thead> <tr class=\\\"bg-secondary text-light\\\"> <th><i18n>rss-widget.widget.channel.feed.title</i18n></th> <th><i18n>rss-widget.widget.channel.feed.show</i18n></th> <th></th> </tr> </thead> <tbody> <tr class=\\\"c-pointer\\\" ng-repeat=\\\"feed in ctrl.channel.feeds track by $index\\\" ng-class=\\\"{ 'table-active' : ctrl.display.feedEdition && $index === ctrl.selectedFeedIndex }\\\"> <td ng-click=\\\"ctrl.openFeedEdition($index)\\\">[[ctrl.channel.feeds[$index].title]]</td> <td ng-click=\\\"ctrl.openFeedEdition($index)\\\">[[ctrl.channel.feeds[$index].show]]</td> <td ng-click=\\\"ctrl.removeFeed($index)\\\"> <button type=\\\"button\\\" class=\\\"btn-close\\\" aria-label=\\\"Close\\\"></button> </td> </tr> </tbody> </table> </div> <form autocomplete=\\\"off\\\" id=\\\"formFeedEdition\\\" ng-if=\\\"ctrl.display.feedEdition\\\"> <div class=\\\"form-group row\\\"> <label for=\\\"inputFeedTitle\\\" class=\\\"col-sm-4 col-form-label\\\"><i18n>rss-widget.widget.channel.feed.title</i18n></label> <div class=\\\"col-sm-8\\\"> <input type=\\\"text\\\" i18n-placeholder=\\\"rss-widget.widget.channel.feed.title.placeholder\\\" id=\\\"inputFeedTitle\\\" class=\\\"form-control\\\" ng-model=\\\"ctrl.selectedFeed.title\\\"/> </div> </div> <div class=\\\"form-group row mt-3\\\"> <label for=\\\"inputFeedUrl\\\" class=\\\"col-sm-4 col-form-label\\\"><i18n>rss-widget.widget.channel.feed.url</i18n></label> <div class=\\\"col-sm-8\\\"> <input type=\\\"text\\\" i18n-placeholder=\\\"rss-widget.widget.channel.feed.url.placeholder\\\" id=\\\"inputFeedUrl\\\" class=\\\"form-control\\\" ng-model=\\\"ctrl.selectedFeed.link\\\"/> </div> </div> <div class=\\\"form-group row mt-3\\\"> <label for=\\\"inputFeedShow\\\" class=\\\"col-sm-4 col-form-label\\\"><i18n>rss-widget.widget.channel.feed.show</i18n></label> <div class=\\\"col-sm-8\\\"> <select id=\\\"inputFeedShow\\\" class=\\\"form-control\\\" ng-options=\\\"n for n in ctrl.showValues\\\" ng-model=\\\"ctrl.selectedFeed.show\\\"></select> </div> </div> </form> </ode-modal-body> <ode-modal-footer> <div ng-if=\\\"!ctrl.display.feedEdition && ctrl.canAddFeed\\\"> <button class=\\\"btn btn-primary\\\" ng-click=\\\"ctrl.openFeedEdition()\\\" translate content=\\\"rss-widget.widget.channel.feed.add\\\"></button> </div> <div ng-if=\\\"ctrl.display.feedEdition\\\"> <button form=\\\"formFeedEdition\\\" type=\\\"reset\\\" class=\\\"btn btn-light\\\" ng-click=\\\"ctrl.closeFeedEdition()\\\"> <i18n>rss-widget.widget.channel.feed.cancel</i18n> </button> <button form=\\\"formFeedEdition\\\" type=\\\"submit\\\" class=\\\"btn btn-primary\\\" ng-click=\\\"ctrl.saveFeed()\\\"> <i18n>rss-widget.widget.channel.feed.save</i18n> </button> </div> </ode-modal-footer> </ode-modal>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { L10n, conf, notif, http, TrackedAction, TrackedScope, TrackedActionFromWidget } from \"../../utils\";\n\ntype Feed = {title:string, link:string, show?:number};\ntype Channel = {\n\t_id?:string;\n\tfeeds: Array<Feed>;\n\towner?: {\n\t userId: string;\n\t displayName: string;\n\t};\n\tcreated?: {\n\t \"$date\": number\n\t};\n\tmodified?: {\n\t \"$date\": number\n\t};\n}\ntype RssContent = {\n\ttitle: string;\n\tlink: string;\n\tdescription: string;\n\tpubDate: string;\n}\ntype FeedContent = RssContent & {\n\tlanguage: string;\n\tItems: Array<RssContent>;\n\tstatus: number;\n}\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tchannel:Channel = undefined as unknown as Channel;\n\tfeeds:Feed[] = [];\n\tselectedFeed?:Feed;\n\tselectedFeedIndex?:number;\n\ttotalFeeds = 10; // limit of feeds\n\tdefaultShow = 3; // limit of article by feeds\n\tshowValues = [1,2,3,4,5,6,7,8,9,10];\n\tdisplay:{\n\t\tedition:boolean;\n\t\tfeedEdition:boolean;\n\t\tselectedFeed?:number;\n\t} = {\n\t\tedition: false,\n\t\tfeedEdition: false,\n\t\tselectedFeed: 0\n\t};\n\n\tinitFeeds():Promise<void> {\n\t\tif(this.channel === undefined){\n\t\t\treturn http().get<Channel[]>('/rss/channels')\n\t\t\t.then( channels => {\n\t\t\t\tif(channels && channels.length > 0) {\n\t\t\t\t\tthis.channel = channels[0];\n\t\t\t\t} else {\n\t\t\t\t\tthis.channel = {feeds:[]};\n\t\t\t\t}\n\t\t\t\treturn this.loadFeeds(0); // 0 : default, from the cache\n\t\t\t})\n\t\t\t.catch( e => {\n\t\t\t\tconsole.warn(\"[widget.rss] failed to initFeeds: \", e)\n\t\t\t\tthis.channel = {feeds:[]};\n\t\t\t});\n\t\t} else {\n\t\t\treturn this.loadFeeds(0); // 0 : default, from the cache\n\t\t}\n\t}\n\n\tprivate loadFeeds( force:number ):Promise<void> {\n\t\tthis.feeds = [];\n\t\treturn Promise.all( this.channel.feeds.map( feed => {\n\t\t\tconst mytitle = feed.title;\n\t\t\tif(feed.link !== null && feed.link !== \"\"){\n\t\t\t\treturn http().get<FeedContent>('/rss/feed/items?url=' + encodeURIComponent(feed.link) + '&force=' + force)\n\t\t\t\t.then( result => {\n\t\t\t\t\tif(typeof result===\"object\" && !result.title) result.title = mytitle;\n\t\t\t\t\tif(result.status===200 && this.feeds.length < this.totalFeeds){\n\t\t\t\t\t\tif(result.Items !== undefined && feed.show != undefined && result.Items.length > feed.show){\n\t\t\t\t\t\t\tresult.Items = result.Items.slice(0, feed.show);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.feeds.push(result);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch( e => {\n\t\t\t\t\tconsole.warn(\"[widget.rss] failed to loadFeeds: \", e);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn Promise.resolve();\n\t\t\t}\n\t\t}))\n\t\t.then( results => {} );\n\t};\n\n\tpublic get canAddFeed():boolean {\n\t\tconst ww = $(window).width();\n\t\treturn (this.channel && this.channel.feeds.length < this.totalFeeds) && (typeof ww!==\"number\" || ww >= 992);\n\t}\n\t\n\topenFeedEdition(index:number) {\n\t\tif(typeof index===\"number\" && index >= 0 && index < this.totalFeeds){\n\t\t\tthis.selectedFeed = angular.copy(this.channel.feeds[index]);\n\t\t\tthis.selectedFeedIndex = index;\n\t\t}else{\n\t\t\tthis.selectedFeed = {title:\"\", link:\"\", show:3};\n\t\t\tthis.selectedFeedIndex = -1;\n\t\t}\n\t\tthis.display.feedEdition = true;\n\t}\n\t\n\tcloseFeedEdition() {\n\t\tthis.display.feedEdition = false;\n\t\tthis.selectedFeed = undefined;\n\t\tthis.selectedFeedIndex = undefined;\n\t}\n\t\n\tremoveFeed(index:number){\n\t\tif(typeof index===\"number\" && index >= 0 && index < this.totalFeeds){\n\t\t\tthis.channel.feeds.splice(index, 1);\n\t\t\tthis.saveChannel();\n\t\t}\n\t}\n\n\tvalidFeed( feed?:Feed ){\n\t\treturn (feed && feed.title && feed.title.trim()!==\"\" && feed.link && feed.link.trim()!==\"\");\n\t}\n\t\n\tsaveFeed(){\n\t\tif(typeof this.selectedFeedIndex===\"number\" && this.validFeed(this.selectedFeed)){\n\t\t\tif( this.selectedFeed ) {\n\t\t\t\tif(this.selectedFeedIndex >= 0 && this.selectedFeedIndex < this.totalFeeds){\n\t\t\t\t\tthis.channel.feeds[this.selectedFeedIndex] = this.selectedFeed;\n\t\t\t\t}else{\n\t\t\t\t\tthis.channel.feeds.push(this.selectedFeed);\n\t\t\t\t}\n\t\t\t\tthis.saveChannel();\n\t\t\t}\n\t\t}\n\t\tthis.closeFeedEdition();\n\t}\n\n\tsaveChannel(){\n\t\tif(this.channel._id) {\n\t\t\tthis.editChannel();\n\t\t}\n\t\telse{\n\t\t\tthis.createChannel();\n\t\t}\n\t}\n\n\tcreateChannel() {\n\t\tif(this.channel){\n\t\t\thttp().postJson('/rss/channel', this.channel)\n\t\t\t.then( response => {\n\t\t\t\tthis.channel._id = response._id;\n\t\t\t\tthis.loadFeeds(0); // 0 : default, from the cache\n\t\t\t});\n\t\t} else {\n\t\t\tconsole.log(\"createChannel : channel is undefined\");\n\t\t}\n\t}\n\t\n\teditChannel() {\n\t\tif(this.channel && this.channel._id){\n\t\t\thttp().putJson('/rss/channel/' + this.channel._id, {feeds: this.channel.feeds})\n\t\t\t.then( response => {\n\t\t\t\tthis.loadFeeds(0); // 0 : default, from the cache\n\t\t\t});\n\t\t} else {\n\t\t\tconsole.log(\"editChannel : channel is undefined\");\n\t\t}\n\t}\n\t\n\tshowOrHideFeed( index:number ){\n\t\tif(this.display.selectedFeed === index){\n\t\t\tthis.display.selectedFeed = undefined;\n\t\t} else {\n\t\t\tthis.display.selectedFeed = index;\n\t\t}\n\t}\n\t\n\tformatDate( date:any ){\n\t\tvar momentDate;\n\t\tif (typeof date === \"number\"){\n\t\t\tmomentDate = L10n.unix(date);\n\t\t} else {\n\t\t\tmomentDate = L10n.moment(date, undefined, 'en');\n\t\t}\n\t\treturn momentDate.locale('fr').format('dddd DD MMMM YYYY HH:mm');\n\t};\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./rss-widget.widget.html').default;\n\tcontroller = [Controller];\n\tcontrollerAs = 'ctrl';\n require = ['odeRssWidget'];\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// init channel & feeds\n\t\tctrl.initFeeds().then( () => {\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 && typeof p.detail?.open==='string' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.rss, 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 rss-widget 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 = \"odeRssWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeRssWidget\", DirectiveFactory );\n"],"names":["channel","undefined","feeds","totalFeeds","defaultShow","showValues","display","edition","feedEdition","selectedFeed","initFeeds","this","http","get","then","channels","length","loadFeeds","catch","e","console","warn","force","Promise","all","map","feed","mytitle","title","link","encodeURIComponent","result","status","Items","show","slice","push","resolve","results","ww","$","window","width","openFeedEdition","index","copy","selectedFeedIndex","closeFeedEdition","removeFeed","splice","saveChannel","validFeed","trim","saveFeed","_id","editChannel","createChannel","postJson","response","log","putJson","showOrHideFeed","formatDate","date","L10n","unix","moment","locale","format","restrict","template","controller","Controller","controllerAs","require","scope","elem","attrs","controllers","ctrl","$apply","trackEvent","p","bubbles","event","detail","open","CustomEvent","TrackedActionFromWidget","rss","currentTarget","dispatchEvent","notif","onLangReady","promise","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""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AAM,eAAEC,QACzBF,EAAQ,IAAIG,YAAa,EAAAC,wBAAwBC,IAAKP,IAEnDE,GAASjE,EAAEuE,eACdvE,EAAEuE,cAAcC,cAAcP,EAEhC,EACD,EACD,EA9BA,IAsCA,IAAAQ,SAAQC,cAAcC,QAAQhF,KAAM,SAAAiF,IAEzB,IAAAC,QAAOC,SAASC,MAAMC,QAAS,EAAQ,MAElD,GAIa,EAAAC,cAAgB,qBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,eAd9C,WACC,OAAO,IAAIC,CACZ,E","sources":["webpack://ode-ngjs-front/./src/ts/widgets/rss-widget/rss-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/rss-widget/rss-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \" <div class=\\\"widget-rss\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"><i18n>rss-widget.widget.title</i18n></div> <div class=\\\"widget-options\\\"> <div class=\\\"tools\\\"> <a href=\\\"#\\\" class=\\\"tool tool-option\\\" i18n-title=\\\"rss-widget.widget.channel.config\\\" ng-if=\\\"ctrl.canAddFeed\\\" ng-click=\\\"ctrl.display.edition = true\\\"> <i class=\\\"fas fa-cog\\\"></i> </a> </div> <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 link\\\" ng-click=\\\"ctrl.display.edition = true\\\" ng-if=\\\"ctrl.channel===undefined || ctrl.channel.feeds.length === 0\\\"> <i18n>rss-widget.widget.empty.info</i18n> </div> <div class=\\\"widget-empty-message link\\\" ng-if=\\\"ctrl.channel && ctrl.channel.feeds.length > 0 && ctrl.feeds.length === 0\\\"> <i18n>rss-widget.widget.channel.feed.no.result</i18n> </div> <div class=\\\"rss-feed\\\" ng-if=\\\"ctrl.feeds !== undefined\\\" ng-repeat=\\\"feed in ctrl.feeds track by $index\\\"> <div class=\\\"feed-title\\\" ng-click=\\\"ctrl.showOrHideFeed($index)\\\">[[feed.title]]</div> <ul class=\\\"list\\\" ng-show=\\\"ctrl.display.selectedFeed === [[$index]]\\\"> <li class=\\\"item link\\\" ng-repeat=\\\"item in feed.Items track by $index\\\"> <a href=\\\"[[item.link]]\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" ng-click=\\\"trackEvent($event, {detail:{'open':item.link} })\\\"> <div class=\\\"title\\\">[[item.title]]</div> <div class=\\\"meta\\\">[[ctrl.formatDate(item.pubDate)]]</div> <div class=\\\"meta\\\" ng-bind-html=\\\"item.description\\\"></div> </a> </li> </ul> </div> </div> </div> <ode-modal visible=\\\"ctrl.display.edition\\\" on-close=\\\"ctrl.display.edition = false\\\" dnd-nodrag> <ode-modal-title> <i18n ng-if=\\\"!ctrl.display.feedEdition\\\">rss-widget.widget.channel.feed.list</i18n> <i18n ng-if=\\\"ctrl.display.feedEdition\\\">rss-widget.widget.channel.feed.edit</i18n> </ode-modal-title> <ode-modal-body> <div ng-if=\\\"!ctrl.display.feedEdition\\\"> <p ng-if=\\\"ctrl.channel.feeds.length === 0\\\"><i18n>rss-widget.widget.channel.undefined</i18n></p> <table class=\\\"table table-hover\\\" ng-if=\\\"ctrl.channel.feeds.length > 0\\\"> <thead> <tr class=\\\"bg-secondary text-light\\\"> <th><i18n>rss-widget.widget.channel.feed.title</i18n></th> <th><i18n>rss-widget.widget.channel.feed.show</i18n></th> <th></th> </tr> </thead> <tbody> <tr class=\\\"c-pointer\\\" ng-repeat=\\\"feed in ctrl.channel.feeds track by $index\\\" ng-class=\\\"{ 'table-active' : ctrl.display.feedEdition && $index === ctrl.selectedFeedIndex }\\\"> <td ng-click=\\\"ctrl.openFeedEdition($index)\\\">[[ctrl.channel.feeds[$index].title]]</td> <td ng-click=\\\"ctrl.openFeedEdition($index)\\\">[[ctrl.channel.feeds[$index].show]]</td> <td ng-click=\\\"ctrl.removeFeed($index)\\\"> <button type=\\\"button\\\" class=\\\"btn-close\\\" aria-label=\\\"Close\\\"></button> </td> </tr> </tbody> </table> </div> <form autocomplete=\\\"off\\\" id=\\\"formFeedEdition\\\" ng-if=\\\"ctrl.display.feedEdition\\\"> <div class=\\\"form-group row\\\"> <label for=\\\"inputFeedTitle\\\" class=\\\"col-sm-4 col-form-label\\\"><i18n>rss-widget.widget.channel.feed.title</i18n></label> <div class=\\\"col-sm-8\\\"> <input type=\\\"text\\\" i18n-placeholder=\\\"rss-widget.widget.channel.feed.title.placeholder\\\" id=\\\"inputFeedTitle\\\" class=\\\"form-control\\\" ng-model=\\\"ctrl.selectedFeed.title\\\"/> </div> </div> <div class=\\\"form-group row mt-3\\\"> <label for=\\\"inputFeedUrl\\\" class=\\\"col-sm-4 col-form-label\\\"><i18n>rss-widget.widget.channel.feed.url</i18n></label> <div class=\\\"col-sm-8\\\"> <input type=\\\"text\\\" i18n-placeholder=\\\"rss-widget.widget.channel.feed.url.placeholder\\\" id=\\\"inputFeedUrl\\\" class=\\\"form-control\\\" ng-model=\\\"ctrl.selectedFeed.link\\\"/> </div> </div> <div class=\\\"form-group row mt-3\\\"> <label for=\\\"inputFeedShow\\\" class=\\\"col-sm-4 col-form-label\\\"><i18n>rss-widget.widget.channel.feed.show</i18n></label> <div class=\\\"col-sm-8\\\"> <select id=\\\"inputFeedShow\\\" class=\\\"form-control\\\" ng-options=\\\"n for n in ctrl.showValues\\\" ng-model=\\\"ctrl.selectedFeed.show\\\"></select> </div> </div> </form> </ode-modal-body> <ode-modal-footer> <div ng-if=\\\"!ctrl.display.feedEdition && ctrl.canAddFeed\\\"> <button class=\\\"btn btn-primary\\\" ng-click=\\\"ctrl.openFeedEdition()\\\" translate content=\\\"rss-widget.widget.channel.feed.add\\\"></button> </div> <div ng-if=\\\"ctrl.display.feedEdition\\\"> <button form=\\\"formFeedEdition\\\" type=\\\"reset\\\" class=\\\"btn btn-light\\\" ng-click=\\\"ctrl.closeFeedEdition()\\\"> <i18n>rss-widget.widget.channel.feed.cancel</i18n> </button> <button form=\\\"formFeedEdition\\\" type=\\\"submit\\\" class=\\\"btn btn-primary\\\" ng-click=\\\"ctrl.saveFeed()\\\"> <i18n>rss-widget.widget.channel.feed.save</i18n> </button> </div> </ode-modal-footer> </ode-modal>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { L10n, conf, notif, http, TrackedAction, TrackedScope, TrackedActionFromWidget } from \"../../utils\";\n\ntype Feed = {title:string, link:string, show?:number};\ntype Channel = {\n\t_id?:string;\n\tfeeds: Array<Feed>;\n\towner?: {\n\t userId: string;\n\t displayName: string;\n\t};\n\tcreated?: {\n\t \"$date\": number\n\t};\n\tmodified?: {\n\t \"$date\": number\n\t};\n}\ntype RssContent = {\n\ttitle: string;\n\tlink: string;\n\tdescription: string;\n\tpubDate: string;\n}\ntype FeedContent = RssContent & {\n\tlanguage: string;\n\tItems: Array<RssContent>;\n\tstatus: number;\n}\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tchannel:Channel = undefined as unknown as Channel;\n\tfeeds:Feed[] = [];\n\tselectedFeed?:Feed;\n\tselectedFeedIndex?:number;\n\ttotalFeeds = 10; // limit of feeds\n\tdefaultShow = 3; // limit of article by feeds\n\tshowValues = [1,2,3,4,5,6,7,8,9,10];\n\tdisplay:{\n\t\tedition:boolean;\n\t\tfeedEdition:boolean;\n\t\tselectedFeed?:number;\n\t} = {\n\t\tedition: false,\n\t\tfeedEdition: false,\n\t\tselectedFeed: 0\n\t};\n\n\tinitFeeds():Promise<void> {\n\t\tif(this.channel === undefined){\n\t\t\treturn http().get<Channel[]>('/rss/channels')\n\t\t\t.then( channels => {\n\t\t\t\tif(channels && channels.length > 0) {\n\t\t\t\t\tthis.channel = channels[0];\n\t\t\t\t} else {\n\t\t\t\t\tthis.channel = {feeds:[]};\n\t\t\t\t}\n\t\t\t\treturn this.loadFeeds(0); // 0 : default, from the cache\n\t\t\t})\n\t\t\t.catch( e => {\n\t\t\t\tconsole.warn(\"[widget.rss] failed to initFeeds: \", e)\n\t\t\t\tthis.channel = {feeds:[]};\n\t\t\t});\n\t\t} else {\n\t\t\treturn this.loadFeeds(0); // 0 : default, from the cache\n\t\t}\n\t}\n\n\tprivate loadFeeds( force:number ):Promise<void> {\n\t\tthis.feeds = [];\n\t\treturn Promise.all( this.channel.feeds.map( feed => {\n\t\t\tconst mytitle = feed.title;\n\t\t\tif(feed.link !== null && feed.link !== \"\"){\n\t\t\t\treturn http().get<FeedContent>('/rss/feed/items?url=' + encodeURIComponent(feed.link) + '&force=' + force)\n\t\t\t\t.then( result => {\n\t\t\t\t\tif(typeof result===\"object\" && !result.title) result.title = mytitle;\n\t\t\t\t\tif(result.status===200 && this.feeds.length < this.totalFeeds){\n\t\t\t\t\t\tif(result.Items !== undefined && feed.show != undefined && result.Items.length > feed.show){\n\t\t\t\t\t\t\tresult.Items = result.Items.slice(0, feed.show);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.feeds.push(result);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch( e => {\n\t\t\t\t\tconsole.warn(\"[widget.rss] failed to loadFeeds: \", e);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn Promise.resolve();\n\t\t\t}\n\t\t}))\n\t\t.then( results => {} );\n\t};\n\n\tpublic get canAddFeed():boolean {\n\t\tconst ww = $(window).width();\n\t\treturn (this.channel && this.channel.feeds.length < this.totalFeeds) && (typeof ww!==\"number\" || ww >= 992);\n\t}\n\t\n\topenFeedEdition(index:number) {\n\t\tif(typeof index===\"number\" && index >= 0 && index < this.totalFeeds){\n\t\t\tthis.selectedFeed = angular.copy(this.channel.feeds[index]);\n\t\t\tthis.selectedFeedIndex = index;\n\t\t}else{\n\t\t\tthis.selectedFeed = {title:\"\", link:\"\", show:3};\n\t\t\tthis.selectedFeedIndex = -1;\n\t\t}\n\t\tthis.display.feedEdition = true;\n\t}\n\t\n\tcloseFeedEdition() {\n\t\tthis.display.feedEdition = false;\n\t\tthis.selectedFeed = undefined;\n\t\tthis.selectedFeedIndex = undefined;\n\t}\n\t\n\tremoveFeed(index:number){\n\t\tif(typeof index===\"number\" && index >= 0 && index < this.totalFeeds){\n\t\t\tthis.channel.feeds.splice(index, 1);\n\t\t\tthis.saveChannel();\n\t\t}\n\t}\n\n\tvalidFeed( feed?:Feed ){\n\t\treturn (feed && feed.title && feed.title.trim()!==\"\" && feed.link && feed.link.trim()!==\"\");\n\t}\n\t\n\tsaveFeed(){\n\t\tif(typeof this.selectedFeedIndex===\"number\" && this.validFeed(this.selectedFeed)){\n\t\t\tif( this.selectedFeed ) {\n\t\t\t\tif(this.selectedFeedIndex >= 0 && this.selectedFeedIndex < this.totalFeeds){\n\t\t\t\t\tthis.channel.feeds[this.selectedFeedIndex] = this.selectedFeed;\n\t\t\t\t}else{\n\t\t\t\t\tthis.channel.feeds.push(this.selectedFeed);\n\t\t\t\t}\n\t\t\t\tthis.saveChannel();\n\t\t\t}\n\t\t}\n\t\tthis.closeFeedEdition();\n\t}\n\n\tsaveChannel(){\n\t\tif(this.channel._id) {\n\t\t\tthis.editChannel();\n\t\t}\n\t\telse{\n\t\t\tthis.createChannel();\n\t\t}\n\t}\n\n\tcreateChannel() {\n\t\tif(this.channel){\n\t\t\thttp().postJson('/rss/channel', this.channel)\n\t\t\t.then( response => {\n\t\t\t\tthis.channel._id = response._id;\n\t\t\t\tthis.loadFeeds(0); // 0 : default, from the cache\n\t\t\t});\n\t\t} else {\n\t\t\tconsole.log(\"createChannel : channel is undefined\");\n\t\t}\n\t}\n\t\n\teditChannel() {\n\t\tif(this.channel && this.channel._id){\n\t\t\thttp().putJson('/rss/channel/' + this.channel._id, {feeds: this.channel.feeds})\n\t\t\t.then( response => {\n\t\t\t\tthis.loadFeeds(0); // 0 : default, from the cache\n\t\t\t});\n\t\t} else {\n\t\t\tconsole.log(\"editChannel : channel is undefined\");\n\t\t}\n\t}\n\t\n\tshowOrHideFeed( index:number ){\n\t\tif(this.display.selectedFeed === index){\n\t\t\tthis.display.selectedFeed = undefined;\n\t\t} else {\n\t\t\tthis.display.selectedFeed = index;\n\t\t}\n\t}\n\t\n\tformatDate( date:any ){\n\t\tvar momentDate;\n\t\tif (typeof date === \"number\"){\n\t\t\tmomentDate = L10n.unix(date);\n\t\t} else {\n\t\t\tmomentDate = L10n.moment(date, undefined, 'en');\n\t\t}\n\t\treturn momentDate.locale('fr').format('dddd DD MMMM YYYY HH:mm');\n\t};\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./rss-widget.widget.html').default;\n\tcontroller = [Controller];\n\tcontrollerAs = 'ctrl';\n require = ['odeRssWidget'];\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// init channel & feeds\n\t\tctrl.initFeeds().then( () => {\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 && typeof p.detail?.open==='string' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.rss, 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 rss-widget 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 = \"odeRssWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeRssWidget\", DirectiveFactory );\n"],"names":["channel","undefined","feeds","totalFeeds","defaultShow","showValues","display","edition","feedEdition","selectedFeed","initFeeds","this","http","get","then","channels","length","loadFeeds","catch","e","console","warn","force","Promise","all","map","feed","mytitle","title","link","encodeURIComponent","result","status","Items","show","slice","push","resolve","results","ww","$","window","width","openFeedEdition","index","copy","selectedFeedIndex","closeFeedEdition","removeFeed","splice","saveChannel","validFeed","trim","saveFeed","_id","editChannel","createChannel","postJson","response","log","putJson","showOrHideFeed","formatDate","date","L10n","unix","moment","locale","format","restrict","template","controller","Controller","controllerAs","require","scope","elem","attrs","controllers","ctrl","$apply","trackEvent","p","bubbles","event","detail","open","CustomEvent","TrackedActionFromWidget","rss","currentTarget","dispatchEvent","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([[306],{4257:(e,t,n)=>{n.d(t,{Z:()=>o});const o='<div class="widget-school"> <div class="widget-body"> <div class="widget-school-header" ng-style="ctrl.getWidgetStyle()"> <div class="d-flex align-items-center"> <div class="me-16"> <a href="/userbook/mon-compte" class="avatar-link" i18n-title="navbar.myaccount" ng-click="trackEvent($event, {detail:{\'open\':\'profile\'} })"> <img data-ng-src="[[ctrl.avatar ? ctrl.avatar+\'?thumbnail=48x48\' : \'\']]" alt="{{ctrl.description.displayName}}"/> </a> </div> <div class="flex-grow-1"> <div class="name">{{ctrl.description.displayName}}</div> <div ng-if="!ctrl.hasManySchools" class="school">{{ctrl.selectedSchool.name}}</div> <div ng-if="ctrl.hasManySchools" class="dropdown"> <div class="school-multiple dropdown-toggle" role="button" id="ddSchoolWidgetSchool" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a href="" class="text-white">{{ctrl.selectedSchool.name}}</a> </div> <div class="school-choice dropdown-menu" aria-labelledby="ddSchoolWidgetSchool"> <div tabindex="0" role="button" class="dropdown-item" ng-repeat="school in ctrl.description.schools" ng-click="ctrl.onSchoolSelected($index)" ng-keydown="ctrl.onSchoolSelected($index, $event)"> {{school.name}} </div> </div> </div> </div> </div> </div> <div class="btn-group"> <a href="/userbook/annuaire#/search" class="btn btn-secondary rounded-pill" ng-if="ctrl.isStudent" ng-click="trackEvent($event, {detail:{\'open\':\'student.class\'} })" translate content="school-widget.widget.my.classroom"></a> <a ng-href="{{ctrl.getUrlTeachersOfMyClass()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isStudent" ng-click="trackEvent($event, {detail:{\'open\':\'student.teachers\'} })" translate content="school-widget.widget.my.team"></a> <a ng-href="{{ctrl.getUrlStudentsOfMyClasses()}}" class="btn btn-secondary rounded-pill" ng-if="ctrl.isTeacher" ng-click="trackEvent($event, {detail:{\'open\':\'teacher.students\'} })" translate content="school-widget.widget.my.classrooms"></a> <a ng-href="{{ctrl.getUrlSchoolTeachers()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isTeacher" ng-click="trackEvent($event, {detail:{\'open\':\'teacher.teachers\'} })" translate content="school-widget.widget.school.team"></a> <a ng-href="{{ctrl.getUrlTeachersOfMyChildren()}}" class="btn btn-secondary rounded-pill" ng-if="ctrl.isRelative" ng-click="trackEvent($event, {detail:{\'open\':\'relative.teachers\'} })" translate content="school-widget.widget.school.team"></a> <a ng-href="{{ctrl.getUrlSchoolPersonnels()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isRelative" ng-click="trackEvent($event, {detail:{\'open\':\'relative.direction\'} })" translate content="school-widget.widget.school.managers"></a> <a ng-href="{{ctrl.getUrlSchoolPersonnelsAndTeachers()}}" class="btn btn-secondary rounded-pill" ng-if="ctrl.isPersonnel" ng-click="trackEvent($event, {detail:{\'open\':\'personnel.personnels\'} })" translate content="school-widget.widget.school.personnelAndTeachers"></a> <a ng-href="{{ctrl.getUrlStudents()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isPersonnel" ng-click="trackEvent($event, {detail:{\'open\':\'personnel.students\'} })" translate content="school-widget.widget.students"></a> </div> </div> </div> '},5623:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,s){function l(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,i)}c((o=o.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,o,r,s,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function i(s){return function(i){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return l.label++,{value:s[1],done:!1};case 5:l.label++,o=s[1],s=[0];continue;case 7:s=l.ops.pop(),l.trys.pop();continue;default:if(!(r=l.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){l=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){l.label=s[1];break}if(6===s[0]&&l.label<r[1]){l.label=r[1],r=s;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(s);break}r[2]&&l.ops.pop(),l.trys.pop();continue}s=t.call(e,l)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,i])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.odeModuleName=void 0;var l=s(n(4202)),i=n(5262),c=n(9419),a=function(){function e(e){this.themeHelperSvc=e}return Object.defineProperty(e.prototype,"me",{get:function(){return(0,c.session)().user},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){return(0,c.session)().description},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"avatar",{get:function(){return(0,c.session)().avatarUrl},enumerable:!1,configurable:!0}),e.prototype.initialize=function(){var e,t;return o(this,void 0,void 0,(function(){var n,o,s=this;return r(this,(function(r){switch(r.label){case 0:return this._userPref=null===(e=i.WidgetFrameworkFactory.instance().list.find((function(e){return e.platformConf.name===i.WIDGET_NAME.SCHOOL})))||void 0===e?void 0:e.userPref,n=this,[4,this.themeHelperSvc.getBootstrapThemePath()];case 1:return n.themePath=r.sent(),[4,(0,c.notif)().onSessionReady().promise];case 2:return r.sent(),o=0,(null===(t=this._userPref)||void 0===t?void 0:t.schoolId)&&l.default.isArray(this.description.schools)&&(o=this.description.schools.findIndex((function(e){var t;return e.id===(null===(t=s._userPref)||void 0===t?void 0:t.schoolId)})),o<0&&(o=0)),this.setSelectedSchool(o),[2]}}))}))},e.prototype.getWidgetStyle=function(){return{"background-image":"url("+this.themePath+"/images/widget-3.png)"}},e.prototype.onSchoolSelected=function(e,t){var n;return(!t||"keydown"===t.type&&(13===t.which||32===t.which))&&(this._userPref&&this.setSelectedSchool(e)&&(this._userPref.schoolId=null===(n=this.selectedSchool)||void 0===n?void 0:n.id,i.WidgetFrameworkFactory.instance().saveUserPrefs()),!0)},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.prototype.getDefaultUrl=function(){return"/userbook/annuaire#/search"},e.prototype.getUrlTeachersOfMyClass=function(){var e=this.getDefaultUrl();if(this.me.classes&&this.me.classes.length>0){e+="?filters=groups&profile=Teacher";for(var t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}}return e},e.prototype.getUrlStudentsOfMyClasses=function(){var e=this.getDefaultUrl()+"?filters=groups&profile=Student";this.selectedSchool&&(e+="&structure="+this.selectedSchool.id);for(var t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}return e},e.prototype.getUrlSchoolTeachers=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=groups&structure="+this.selectedSchool.id+"&profile=Teacher":this.getDefaultUrl()},e.prototype.getUrlTeachersOfMyChildren=function(){for(var e=this.getDefaultUrl()+"?filters=groups&profile=Teacher",t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}return e},e.prototype.getUrlSchoolPersonnels=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=users&structure="+this.selectedSchool.id+"&profile=Personnel":this.getDefaultUrl()},e.prototype.getUrlSchoolPersonnelsAndTeachers=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=users&structure="+this.selectedSchool.id+"&profile=Personnel&profile=Teacher":this.getDefaultUrl()},e.prototype.getUrlStudents=function(){var e=this.getDefaultUrl()+"?filters=groups&profile=Student";return this.selectedSchool&&(e+="&structure="+this.selectedSchool.id),e},Object.defineProperty(e.prototype,"hasManySchools",{get:function(){return this.description.schools.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStudent",{get:function(){return"ELEVE"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTeacher",{get:function(){return"ENSEIGNANT"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRelative",{get:function(){return"PERSRELELEVE"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPersonnel",{get:function(){return"PERSEDUCNAT"===this.me.type},enumerable:!1,configurable:!0}),e}(),d=function(){function e(){this.restrict="E",this.template=n(4257).Z,this.controller=["odeThemeHelperService",a],this.controllerAs="ctrl",this.require=["odeSchoolWidget"]}return e.prototype.link=function(e,t,n,s){return o(this,void 0,void 0,(function(){var t;return r(this,(function(n){switch(n.label){case 0:return(t=s?s[0]:null)?[4,t.initialize()]:[2];case 1:return n.sent(),e.$apply(),e.trackEvent=function(e,t){var n;void 0===t.bubbles&&(t.bubbles=!0);var o=null;(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.open)&&-1!==["student.class","student.teachers","teacher.students","teacher.teachers","relative.teachers","relative.direction","profile"].indexOf(t.detail.open)&&(o=new CustomEvent(c.TrackedActionFromWidget.school,t)),o&&e.currentTarget&&e.currentTarget.dispatchEvent(o)},[2]}}))}))},e}();(0,c.notif)().onLangReady().promise.then((function(e){(0,c.conf)().Platform.idiom.addKeys(n(3926))})),t.odeModuleName="odeSchoolWidgetModule",l.default.module(t.odeModuleName,[]).directive("odeSchoolWidget",(function(){return new d}))},3926:e=>{e.exports=JSON.parse('{"school-widget.widget.my.classroom":"Ma classe","school-widget.widget.my.classrooms":"Mes classes","school-widget.widget.my.team":"Mes enseignants","school-widget.widget.school.team":"Équipe enseignante","school-widget.widget.school.managers":"Personnels","school-widget.widget.school.personnelAndTeachers":"Personnels et Enseignants","school-widget.widget.students":"Élèves","school-widget":"Mon réseau"}')}}]);
|
|
1
|
+
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[306],{4257:(e,t,n)=>{n.d(t,{Z:()=>o});const o='<div class="widget-school"> <div class="widget-body"> <div class="widget-school-header" ng-style="ctrl.getWidgetStyle()"> <div class="d-flex align-items-center"> <div class="me-16"> <a href="/userbook/mon-compte" class="avatar-link" i18n-title="navbar.myaccount" ng-click="trackEvent($event, {detail:{\'open\':\'profile\'} })"> <img data-ng-src="[[ctrl.avatar ? ctrl.avatar+\'?thumbnail=48x48\' : \'\']]" alt="{{ctrl.description.displayName}}"/> </a> </div> <div class="flex-grow-1"> <div class="name">{{ctrl.description.displayName}}</div> <div ng-if="!ctrl.hasManySchools" class="school">{{ctrl.selectedSchool.name}}</div> <div ng-if="ctrl.hasManySchools" class="dropdown"> <div class="school-multiple dropdown-toggle" role="button" id="ddSchoolWidgetSchool" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a href="" class="text-white">{{ctrl.selectedSchool.name}}</a> </div> <div class="school-choice dropdown-menu" aria-labelledby="ddSchoolWidgetSchool"> <div tabindex="0" role="button" class="dropdown-item" ng-repeat="school in ctrl.description.schools" ng-click="ctrl.onSchoolSelected($index)" ng-keydown="ctrl.onSchoolSelected($index, $event)"> {{school.name}} </div> </div> </div> </div> </div> </div> <div class="btn-group"> <a href="/userbook/annuaire#/search" class="btn btn-secondary rounded-pill" ng-if="ctrl.isStudent" ng-click="trackEvent($event, {detail:{\'open\':\'student.class\'} })" translate content="school-widget.widget.my.classroom"></a> <a ng-href="{{ctrl.getUrlTeachersOfMyClass()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isStudent" ng-click="trackEvent($event, {detail:{\'open\':\'student.teachers\'} })" translate content="school-widget.widget.my.team"></a> <a ng-href="{{ctrl.getUrlStudentsOfMyClasses()}}" class="btn btn-secondary rounded-pill" ng-if="ctrl.isTeacher" ng-click="trackEvent($event, {detail:{\'open\':\'teacher.students\'} })" translate content="school-widget.widget.my.classrooms"></a> <a ng-href="{{ctrl.getUrlSchoolTeachers()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isTeacher" ng-click="trackEvent($event, {detail:{\'open\':\'teacher.teachers\'} })" translate content="school-widget.widget.school.team"></a> <a ng-href="{{ctrl.getUrlTeachersOfMyChildren()}}" class="btn btn-secondary rounded-pill" ng-if="ctrl.isRelative" ng-click="trackEvent($event, {detail:{\'open\':\'relative.teachers\'} })" translate content="school-widget.widget.school.team"></a> <a ng-href="{{ctrl.getUrlSchoolPersonnels()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isRelative" ng-click="trackEvent($event, {detail:{\'open\':\'relative.direction\'} })" translate content="school-widget.widget.school.managers"></a> <a ng-href="{{ctrl.getUrlSchoolPersonnelsAndTeachers()}}" class="btn btn-secondary rounded-pill" ng-if="ctrl.isPersonnel" ng-click="trackEvent($event, {detail:{\'open\':\'personnel.personnels\'} })" translate content="school-widget.widget.school.personnelAndTeachers"></a> <a ng-href="{{ctrl.getUrlStudents()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isPersonnel" ng-click="trackEvent($event, {detail:{\'open\':\'personnel.students\'} })" translate content="school-widget.widget.students"></a> </div> </div> </div> '},5623:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,s){function l(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(l,i)}c((o=o.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,o,r,s,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function i(s){return function(i){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return l.label++,{value:s[1],done:!1};case 5:l.label++,o=s[1],s=[0];continue;case 7:s=l.ops.pop(),l.trys.pop();continue;default:if(!(r=l.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){l=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){l.label=s[1];break}if(6===s[0]&&l.label<r[1]){l.label=r[1],r=s;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(s);break}r[2]&&l.ops.pop(),l.trys.pop();continue}s=t.call(e,l)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,i])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.odeModuleName=void 0;var l=s(n(4202)),i=n(5262),c=n(9419),a=function(){function e(e){this.themeHelperSvc=e}return Object.defineProperty(e.prototype,"me",{get:function(){return(0,c.session)().user},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){return(0,c.session)().description},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"avatar",{get:function(){return(0,c.session)().avatarUrl},enumerable:!1,configurable:!0}),e.prototype.initialize=function(){var e,t;return o(this,void 0,void 0,function(){var n,o,s=this;return r(this,function(r){switch(r.label){case 0:return this._userPref=null===(e=i.WidgetFrameworkFactory.instance().list.find(function(e){return e.platformConf.name===i.WIDGET_NAME.SCHOOL}))||void 0===e?void 0:e.userPref,n=this,[4,this.themeHelperSvc.getBootstrapThemePath()];case 1:return n.themePath=r.sent(),[4,(0,c.notif)().onSessionReady().promise];case 2:return r.sent(),o=0,(null===(t=this._userPref)||void 0===t?void 0:t.schoolId)&&l.default.isArray(this.description.schools)&&(o=this.description.schools.findIndex(function(e){var t;return e.id===(null===(t=s._userPref)||void 0===t?void 0:t.schoolId)}),o<0&&(o=0)),this.setSelectedSchool(o),[2]}})})},e.prototype.getWidgetStyle=function(){return{"background-image":"url("+this.themePath+"/images/widget-3.png)"}},e.prototype.onSchoolSelected=function(e,t){var n;return(!t||"keydown"===t.type&&(13===t.which||32===t.which))&&(this._userPref&&this.setSelectedSchool(e)&&(this._userPref.schoolId=null===(n=this.selectedSchool)||void 0===n?void 0:n.id,i.WidgetFrameworkFactory.instance().saveUserPrefs()),!0)},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.prototype.getDefaultUrl=function(){return"/userbook/annuaire#/search"},e.prototype.getUrlTeachersOfMyClass=function(){var e=this.getDefaultUrl();if(this.me.classes&&this.me.classes.length>0){e+="?filters=groups&profile=Teacher";for(var t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}}return e},e.prototype.getUrlStudentsOfMyClasses=function(){var e=this.getDefaultUrl()+"?filters=groups&profile=Student";this.selectedSchool&&(e+="&structure="+this.selectedSchool.id);for(var t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}return e},e.prototype.getUrlSchoolTeachers=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=groups&structure="+this.selectedSchool.id+"&profile=Teacher":this.getDefaultUrl()},e.prototype.getUrlTeachersOfMyChildren=function(){for(var e=this.getDefaultUrl()+"?filters=groups&profile=Teacher",t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}return e},e.prototype.getUrlSchoolPersonnels=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=users&structure="+this.selectedSchool.id+"&profile=Personnel":this.getDefaultUrl()},e.prototype.getUrlSchoolPersonnelsAndTeachers=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=users&structure="+this.selectedSchool.id+"&profile=Personnel&profile=Teacher":this.getDefaultUrl()},e.prototype.getUrlStudents=function(){var e=this.getDefaultUrl()+"?filters=groups&profile=Student";return this.selectedSchool&&(e+="&structure="+this.selectedSchool.id),e},Object.defineProperty(e.prototype,"hasManySchools",{get:function(){return this.description.schools.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStudent",{get:function(){return"ELEVE"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTeacher",{get:function(){return"ENSEIGNANT"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRelative",{get:function(){return"PERSRELELEVE"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPersonnel",{get:function(){return"PERSEDUCNAT"===this.me.type},enumerable:!1,configurable:!0}),e}(),d=function(){function e(){this.restrict="E",this.template=n(4257).Z,this.controller=["odeThemeHelperService",a],this.controllerAs="ctrl",this.require=["odeSchoolWidget"]}return e.prototype.link=function(e,t,n,s){return o(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return(t=s?s[0]:null)?[4,t.initialize()]:[2];case 1:return n.sent(),e.$apply(),e.trackEvent=function(e,t){var n;void 0===t.bubbles&&(t.bubbles=!0);var o=null;(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.open)&&-1!==["student.class","student.teachers","teacher.students","teacher.teachers","relative.teachers","relative.direction","profile"].indexOf(t.detail.open)&&(o=new CustomEvent(c.TrackedActionFromWidget.school,t)),o&&e.currentTarget&&e.currentTarget.dispatchEvent(o)},[2]}})})},e}();(0,c.notif)().onLangReady().promise.then(function(e){(0,c.conf)().Platform.idiom.addKeys(n(3926))}),t.odeModuleName="odeSchoolWidgetModule",l.default.module(t.odeModuleName,[]).directive("odeSchoolWidget",function(){return new d})},3926:e=>{e.exports=JSON.parse('{"school-widget.widget.my.classroom":"Ma classe","school-widget.widget.my.classrooms":"Mes classes","school-widget.widget.my.team":"Mes enseignants","school-widget.widget.school.team":"Équipe enseignante","school-widget.widget.school.managers":"Personnels","school-widget.widget.school.personnelAndTeachers":"Personnels et Enseignants","school-widget.widget.students":"Élèves","school-widget":"Mon réseau"}')}}]);
|
|
2
2
|
//# sourceMappingURL=school-widget.widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets/school-widget/school-widget.widget.js","mappings":"gIAGA,QAFW,4rG,8iDCDX,iBACA,UACA,UAIA,aACC,WACSA,GAAA,KAAAA,eAAAA,CACN,CAkIJ,OAhIC,sBAAY,iBAAE,C,IAAd,WACC,OAAO,IAAAC,WAAUC,IAClB,E,gCACA,sBAAc,0BAAW,C,IAAzB,WACC,OAAO,IAAAD,WAAUE,WAClB,E,gCACA,sBAAc,qBAAM,C,IAApB,WACC,OAAO,IAAAF,WAAUG,SAClB,E,gCAIa,YAAAC,WAAb,W,iHAEkB,OADjBC,KAAKC,UAAuG,QAA3F,IAAAC,uBAAuBC,WAAW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gCACD,EArIA,GAwIA,0BACI,KAAAgB,SAAW,IACd,KAAAC,SAAW,UACX,KAAAC,WAAa,CAAC,wBAAyBC,GACvC,KAAAC,aAAe,OACf,KAAAC,QAAU,CAAC,kBA4BZ,QA1BU,YAAAC,KAAN,SAAWC,EAAoBC,EAAaC,EAAmBC,G,gGAEjE,OADYC,EAAuBD,EAAcA,EAAY,GAAmB,MAGhF,GAAMC,EAAKzD,cAFE,I,cAEb,SACAqD,EAAMK,SAGNL,EAAMM,WAAa,SAACC,EAASC,G,WAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,MACC,QAAT,EAAAF,aAAC,EAADA,EAAGG,cAAM,eAAEC,QAKe,IAJ5B,CAAC,gBAAkB,mBAClB,mBAAqB,mBACrB,oBAAqB,qBACrB,WACCC,QAAQL,EAAEG,OAAOC,QACpBF,EAAQ,IAAII,YAAa,EAAAC,wBAAwB7C,OAAQsC,IAEtDE,GAASH,EAAES,eACdT,EAAES,cAAcC,cAAcP,EAEhC,E,YAEF,EAjCA,IAyCA,IAAAhD,SAAQwD,cAActD,QAAQuD,MAAM,SAAAC,IAEzB,IAAAC,QAAOC,SAASC,MAAMC,QAAS,EAAQ,MAElD,IAIa,EAAAC,cAAgB,wBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,mBAd9C,WACC,OAAO,IAAIC,CACZ,G","sources":["webpack://ode-ngjs-front/./src/ts/widgets/school-widget/school-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/school-widget/school-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<div class=\\\"widget-school\\\"> <div class=\\\"widget-body\\\"> <div class=\\\"widget-school-header\\\" ng-style=\\\"ctrl.getWidgetStyle()\\\"> <div class=\\\"d-flex align-items-center\\\"> <div class=\\\"me-16\\\"> <a href=\\\"/userbook/mon-compte\\\" class=\\\"avatar-link\\\" i18n-title=\\\"navbar.myaccount\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'profile'} })\\\"> <img data-ng-src=\\\"[[ctrl.avatar ? ctrl.avatar+'?thumbnail=48x48' : '']]\\\" alt=\\\"{{ctrl.description.displayName}}\\\"/> </a> </div> <div class=\\\"flex-grow-1\\\"> <div class=\\\"name\\\">{{ctrl.description.displayName}}</div> <div ng-if=\\\"!ctrl.hasManySchools\\\" class=\\\"school\\\">{{ctrl.selectedSchool.name}}</div> <div ng-if=\\\"ctrl.hasManySchools\\\" class=\\\"dropdown\\\"> <div class=\\\"school-multiple dropdown-toggle\\\" role=\\\"button\\\" id=\\\"ddSchoolWidgetSchool\\\" data-bs-toggle=\\\"dropdown\\\" aria-haspopup=\\\"true\\\" aria-expanded=\\\"false\\\"> <a href=\\\"\\\" class=\\\"text-white\\\">{{ctrl.selectedSchool.name}}</a> </div> <div class=\\\"school-choice dropdown-menu\\\" aria-labelledby=\\\"ddSchoolWidgetSchool\\\"> <div tabindex=\\\"0\\\" role=\\\"button\\\" class=\\\"dropdown-item\\\" ng-repeat=\\\"school in ctrl.description.schools\\\" ng-click=\\\"ctrl.onSchoolSelected($index)\\\" ng-keydown=\\\"ctrl.onSchoolSelected($index, $event)\\\"> {{school.name}} </div> </div> </div> </div> </div> </div> <div class=\\\"btn-group\\\"> <a href=\\\"/userbook/annuaire#/search\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isStudent\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'student.class'} })\\\" translate content=\\\"school-widget.widget.my.classroom\\\"></a> <a ng-href=\\\"{{ctrl.getUrlTeachersOfMyClass()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isStudent\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'student.teachers'} })\\\" translate content=\\\"school-widget.widget.my.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlStudentsOfMyClasses()}}\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isTeacher\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'teacher.students'} })\\\" translate content=\\\"school-widget.widget.my.classrooms\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolTeachers()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isTeacher\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'teacher.teachers'} })\\\" translate content=\\\"school-widget.widget.school.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlTeachersOfMyChildren()}}\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isRelative\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'relative.teachers'} })\\\" translate content=\\\"school-widget.widget.school.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolPersonnels()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isRelative\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'relative.direction'} })\\\" translate content=\\\"school-widget.widget.school.managers\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolPersonnelsAndTeachers()}}\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isPersonnel\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'personnel.personnels'} })\\\" translate content=\\\"school-widget.widget.school.personnelAndTeachers\\\"></a> <a ng-href=\\\"{{ctrl.getUrlStudents()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isPersonnel\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'personnel.students'} })\\\" translate content=\\\"school-widget.widget.students\\\"></a> </div> </div> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective } from \"angular\";\nimport { IUserDescription, IUserInfo, School, WidgetFrameworkFactory, WidgetUserPref, WIDGET_NAME } from \"ode-ts-client\";\nimport { conf, notif, session, TrackedScope, TrackedAction, TrackedActionFromWidget } from \"../../utils\";\nimport { ThemeHelperService } from \"../../services\";\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tconstructor( \n\t\tprivate themeHelperSvc:ThemeHelperService\n\t) {}\n\n\tprivate get me():IUserInfo {\n\t\treturn session().user;\n\t}\n\tprotected get description():IUserDescription {\n\t\treturn session().description;\n\t}\n\tprotected get avatar():string {\n\t\treturn session().avatarUrl;\n\t}\n\n\tprivate _userPref?:WidgetUserPref;\n\n\tpublic async initialize() {\n\t\tthis._userPref = WidgetFrameworkFactory.instance().list.find( w => w.platformConf.name===WIDGET_NAME.SCHOOL)?.userPref;\n\t\tthis.themePath = await this.themeHelperSvc.getBootstrapThemePath();\n\t\tawait notif().onSessionReady().promise;\n\n\t\t// #WB-22, memorize the latest school choice\n\t\tlet defaultIndex = 0;\n\t\tif( this._userPref?.schoolId && angular.isArray(this.description.schools) ) {\n\t\t\tdefaultIndex = this.description.schools.findIndex( school => school.id===this._userPref?.schoolId );\n\t\t\tif( defaultIndex < 0 ) {\n\t\t\t\tdefaultIndex = 0;\n\t\t\t}\n\t\t}\n\t\tthis.setSelectedSchool( defaultIndex );\n\t}\n\n\tprivate selectedSchool?:School;\n\tprivate themePath?:string;\n\n\tprotected getWidgetStyle() {\n\t\treturn {\n\t\t\t'background-image': \"url(\"+ this.themePath +\"/images/widget-3.png)\"\n\t\t};\n\t}\n\n\tprotected onSchoolSelected( idx:number, ev?:JQuery.Event ) {\n\t\t// If an event is given, and related to pressing the enter or spacebar key.\n\t\tif( !ev || (ev.type==='keydown' && (ev.which===13 || ev.which===32)) ) {\t\n\t\t\tif( this._userPref && this.setSelectedSchool(idx) ) {\n\t\t\t\t// Selected school changed => #WB-22, memorize the latest school choice\n\t\t\t\tthis._userPref.schoolId = this.selectedSchool?.id;\n\t\t\t\tWidgetFrameworkFactory.instance().saveUserPrefs();\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate setSelectedSchool( idx:number ):boolean {\n\t\tif( 0 <= idx && idx < this.description.schools.length && this.selectedSchool !== this.description.schools[idx]) {\n\t\t\tthis.selectedSchool = this.description.schools[idx];\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate getDefaultUrl() {\n\t\treturn \"/userbook/annuaire#/search\";\n\t}\n\t\n\tprotected getUrlTeachersOfMyClass() {\n\t\tlet url = this.getDefaultUrl();\n\t\tif( this.me.classes && this.me.classes.length>0 ) {\n\t\t\turl += \"?filters=groups&profile=Teacher\";\n\t\t\tfor( let clazz of this.me.classes ) {\n\t\t\t\turl += \"&class=\"+clazz;\n\t\t\t}\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlStudentsOfMyClasses() {\n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Student\";\n\t\tif( this.selectedSchool ) {\n\t\t\turl += \"&structure=\"+this.selectedSchool.id;\n\t\t}\n\t\tfor( let clazz of this.me.classes ) {\n\t\t\turl += \"&class=\"+clazz;\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlSchoolTeachers() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=groups&structure=\"+this.selectedSchool.id+\"&profile=Teacher\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlTeachersOfMyChildren() {\n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Teacher\";\n\t\tfor( let clazz of this.me.classes ) {\n\t\t\turl += \"&class=\"+clazz;\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlSchoolPersonnels() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=users&structure=\"+this.selectedSchool.id+\"&profile=Personnel\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlSchoolPersonnelsAndTeachers() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=users&structure=\"+this.selectedSchool.id+\"&profile=Personnel&profile=Teacher\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlStudents() { \n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Student\";\n\t\tif( this.selectedSchool ) {\n\t\t\turl += \"&structure=\"+this.selectedSchool.id;\n\t\t}\n\t\treturn url;\n\t}\n\n\tprotected get hasManySchools() {\n\t\treturn this.description.schools.length > 1;\n\t}\n\n\tprotected get isStudent():boolean {\n\t\treturn this.me.type===\"ELEVE\";\n\t}\n\tprotected get isTeacher():boolean {\n\t\treturn this.me.type===\"ENSEIGNANT\";\n\t}\n\tprotected get isRelative():boolean {\n\t\treturn this.me.type===\"PERSRELELEVE\";\n\t}\n\tprotected get isPersonnel():boolean {\n\t\treturn this.me.type===\"PERSEDUCNAT\";\n\t}\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./school-widget.widget.html').default;\n\tcontroller = [\"odeThemeHelperService\", Controller];\n\tcontrollerAs = 'ctrl';\n\trequire = ['odeSchoolWidget'];\n\n async link(scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]) {\n const ctrl:Controller|null = controllers ? controllers[0] as Controller : null;\n\t\tif( ! ctrl ) return;\n\n\t\tawait ctrl.initialize();\n\t\tscope.$apply();\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?.detail?.open &&\n\t\t\t\t\t['student.class'\t\t,'student.teachers'\n\t\t\t\t\t,'teacher.students'\t\t,'teacher.teachers'\n\t\t\t\t\t,'relative.teachers'\t,'relative.direction'\n\t\t\t\t\t,'profile'\n\t\t\t\t\t].indexOf(p.detail.open)!==-1 ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.school, 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 school-widget 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 = \"odeSchoolWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeSchoolWidget\", DirectiveFactory );\n"],"names":["themeHelperSvc","session","user","description","avatarUrl","initialize","this","_userPref","WidgetFrameworkFactory","instance","list","find","w","platformConf","name","WIDGET_NAME","SCHOOL","userPref","getBootstrapThemePath","themePath","notif","onSessionReady","promise","defaultIndex","schoolId","isArray","schools","findIndex","school","id","setSelectedSchool","getWidgetStyle","onSchoolSelected","idx","ev","type","which","selectedSchool","saveUserPrefs","length","getDefaultUrl","getUrlTeachersOfMyClass","url","me","classes","getUrlStudentsOfMyClasses","getUrlSchoolTeachers","getUrlTeachersOfMyChildren","getUrlSchoolPersonnels","getUrlSchoolPersonnelsAndTeachers","getUrlStudents","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","$apply","trackEvent","e","p","bubbles","event","detail","open","indexOf","CustomEvent","TrackedActionFromWidget","currentTarget","dispatchEvent","onLangReady","then","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"widgets/school-widget/school-widget.widget.js","mappings":"gIAGA,QAFW,4rG,0iDCDX,iBACA,UACA,UAIA,aACC,WACSA,GAAA,KAAAA,eAAAA,CACN,CAkIJ,OAhIC,sBAAY,iBAAE,C,IAAd,WACC,OAAO,IAAAC,WAAUC,IAClB,E,gCACA,sBAAc,0BAAW,C,IAAzB,WACC,OAAO,IAAAD,WAAUE,WAClB,E,gCACA,sBAAc,qB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IAAxB,WACC,MAAsB,iBAAf7B,KAAKqC,GAAGR,IAChB,E,gCACA,sBAAc,0BAAW,C,IAAzB,WACC,MAAsB,gBAAf7B,KAAKqC,GAAGR,IAChB,E,gCACD,EArIA,GAwIA,0BACI,KAAAgB,SAAW,IACd,KAAAC,SAAW,UACX,KAAAC,WAAa,CAAC,wBAAyBC,GACvC,KAAAC,aAAe,OACf,KAAAC,QAAU,CAAC,kBA4BZ,QA1BU,YAAAC,KAAN,SAAWC,EAAoBC,EAAaC,EAAmBC,G,8FAEjE,OADYC,EAAuBD,EAAcA,EAAY,GAAmB,MAGhF,GAAMC,EAAKzD,cAFE,I,cAEb,SACAqD,EAAMK,SAGNL,EAAMM,WAAa,SAACC,EAASC,G,WAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,MACC,QAAT,EAAAF,aAAC,EAADA,EAAGG,cAAM,eAAEC,QAKe,IAJ5B,CAAC,gBAAkB,mBAClB,mBAAqB,mBACrB,oBAAqB,qBACrB,WACCC,QAAQL,EAAEG,OAAOC,QACpBF,EAAQ,IAAII,YAAa,EAAAC,wBAAwB7C,OAAQsC,IAEtDE,GAASH,EAAES,eACdT,EAAES,cAAcC,cAAcP,EAEhC,E,UAEF,EAjCA,IAyCA,IAAAhD,SAAQwD,cAActD,QAAQuD,KAAM,SAAAC,IAEzB,IAAAC,QAAOC,SAASC,MAAMC,QAAS,EAAQ,MAElD,GAIa,EAAAC,cAAgB,wBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,kBAd9C,WACC,OAAO,IAAIC,CACZ,E","sources":["webpack://ode-ngjs-front/./src/ts/widgets/school-widget/school-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/school-widget/school-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<div class=\\\"widget-school\\\"> <div class=\\\"widget-body\\\"> <div class=\\\"widget-school-header\\\" ng-style=\\\"ctrl.getWidgetStyle()\\\"> <div class=\\\"d-flex align-items-center\\\"> <div class=\\\"me-16\\\"> <a href=\\\"/userbook/mon-compte\\\" class=\\\"avatar-link\\\" i18n-title=\\\"navbar.myaccount\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'profile'} })\\\"> <img data-ng-src=\\\"[[ctrl.avatar ? ctrl.avatar+'?thumbnail=48x48' : '']]\\\" alt=\\\"{{ctrl.description.displayName}}\\\"/> </a> </div> <div class=\\\"flex-grow-1\\\"> <div class=\\\"name\\\">{{ctrl.description.displayName}}</div> <div ng-if=\\\"!ctrl.hasManySchools\\\" class=\\\"school\\\">{{ctrl.selectedSchool.name}}</div> <div ng-if=\\\"ctrl.hasManySchools\\\" class=\\\"dropdown\\\"> <div class=\\\"school-multiple dropdown-toggle\\\" role=\\\"button\\\" id=\\\"ddSchoolWidgetSchool\\\" data-bs-toggle=\\\"dropdown\\\" aria-haspopup=\\\"true\\\" aria-expanded=\\\"false\\\"> <a href=\\\"\\\" class=\\\"text-white\\\">{{ctrl.selectedSchool.name}}</a> </div> <div class=\\\"school-choice dropdown-menu\\\" aria-labelledby=\\\"ddSchoolWidgetSchool\\\"> <div tabindex=\\\"0\\\" role=\\\"button\\\" class=\\\"dropdown-item\\\" ng-repeat=\\\"school in ctrl.description.schools\\\" ng-click=\\\"ctrl.onSchoolSelected($index)\\\" ng-keydown=\\\"ctrl.onSchoolSelected($index, $event)\\\"> {{school.name}} </div> </div> </div> </div> </div> </div> <div class=\\\"btn-group\\\"> <a href=\\\"/userbook/annuaire#/search\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isStudent\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'student.class'} })\\\" translate content=\\\"school-widget.widget.my.classroom\\\"></a> <a ng-href=\\\"{{ctrl.getUrlTeachersOfMyClass()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isStudent\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'student.teachers'} })\\\" translate content=\\\"school-widget.widget.my.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlStudentsOfMyClasses()}}\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isTeacher\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'teacher.students'} })\\\" translate content=\\\"school-widget.widget.my.classrooms\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolTeachers()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isTeacher\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'teacher.teachers'} })\\\" translate content=\\\"school-widget.widget.school.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlTeachersOfMyChildren()}}\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isRelative\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'relative.teachers'} })\\\" translate content=\\\"school-widget.widget.school.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolPersonnels()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isRelative\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'relative.direction'} })\\\" translate content=\\\"school-widget.widget.school.managers\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolPersonnelsAndTeachers()}}\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isPersonnel\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'personnel.personnels'} })\\\" translate content=\\\"school-widget.widget.school.personnelAndTeachers\\\"></a> <a ng-href=\\\"{{ctrl.getUrlStudents()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isPersonnel\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'personnel.students'} })\\\" translate content=\\\"school-widget.widget.students\\\"></a> </div> </div> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective } from \"angular\";\nimport { IUserDescription, IUserInfo, School, WidgetFrameworkFactory, WidgetUserPref, WIDGET_NAME } from \"ode-ts-client\";\nimport { conf, notif, session, TrackedScope, TrackedAction, TrackedActionFromWidget } from \"../../utils\";\nimport { ThemeHelperService } from \"../../services\";\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tconstructor( \n\t\tprivate themeHelperSvc:ThemeHelperService\n\t) {}\n\n\tprivate get me():IUserInfo {\n\t\treturn session().user;\n\t}\n\tprotected get description():IUserDescription {\n\t\treturn session().description;\n\t}\n\tprotected get avatar():string {\n\t\treturn session().avatarUrl;\n\t}\n\n\tprivate _userPref?:WidgetUserPref;\n\n\tpublic async initialize() {\n\t\tthis._userPref = WidgetFrameworkFactory.instance().list.find( w => w.platformConf.name===WIDGET_NAME.SCHOOL)?.userPref;\n\t\tthis.themePath = await this.themeHelperSvc.getBootstrapThemePath();\n\t\tawait notif().onSessionReady().promise;\n\n\t\t// #WB-22, memorize the latest school choice\n\t\tlet defaultIndex = 0;\n\t\tif( this._userPref?.schoolId && angular.isArray(this.description.schools) ) {\n\t\t\tdefaultIndex = this.description.schools.findIndex( school => school.id===this._userPref?.schoolId );\n\t\t\tif( defaultIndex < 0 ) {\n\t\t\t\tdefaultIndex = 0;\n\t\t\t}\n\t\t}\n\t\tthis.setSelectedSchool( defaultIndex );\n\t}\n\n\tprivate selectedSchool?:School;\n\tprivate themePath?:string;\n\n\tprotected getWidgetStyle() {\n\t\treturn {\n\t\t\t'background-image': \"url(\"+ this.themePath +\"/images/widget-3.png)\"\n\t\t};\n\t}\n\n\tprotected onSchoolSelected( idx:number, ev?:JQuery.Event ) {\n\t\t// If an event is given, and related to pressing the enter or spacebar key.\n\t\tif( !ev || (ev.type==='keydown' && (ev.which===13 || ev.which===32)) ) {\t\n\t\t\tif( this._userPref && this.setSelectedSchool(idx) ) {\n\t\t\t\t// Selected school changed => #WB-22, memorize the latest school choice\n\t\t\t\tthis._userPref.schoolId = this.selectedSchool?.id;\n\t\t\t\tWidgetFrameworkFactory.instance().saveUserPrefs();\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate setSelectedSchool( idx:number ):boolean {\n\t\tif( 0 <= idx && idx < this.description.schools.length && this.selectedSchool !== this.description.schools[idx]) {\n\t\t\tthis.selectedSchool = this.description.schools[idx];\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate getDefaultUrl() {\n\t\treturn \"/userbook/annuaire#/search\";\n\t}\n\t\n\tprotected getUrlTeachersOfMyClass() {\n\t\tlet url = this.getDefaultUrl();\n\t\tif( this.me.classes && this.me.classes.length>0 ) {\n\t\t\turl += \"?filters=groups&profile=Teacher\";\n\t\t\tfor( let clazz of this.me.classes ) {\n\t\t\t\turl += \"&class=\"+clazz;\n\t\t\t}\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlStudentsOfMyClasses() {\n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Student\";\n\t\tif( this.selectedSchool ) {\n\t\t\turl += \"&structure=\"+this.selectedSchool.id;\n\t\t}\n\t\tfor( let clazz of this.me.classes ) {\n\t\t\turl += \"&class=\"+clazz;\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlSchoolTeachers() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=groups&structure=\"+this.selectedSchool.id+\"&profile=Teacher\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlTeachersOfMyChildren() {\n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Teacher\";\n\t\tfor( let clazz of this.me.classes ) {\n\t\t\turl += \"&class=\"+clazz;\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlSchoolPersonnels() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=users&structure=\"+this.selectedSchool.id+\"&profile=Personnel\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlSchoolPersonnelsAndTeachers() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=users&structure=\"+this.selectedSchool.id+\"&profile=Personnel&profile=Teacher\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlStudents() { \n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Student\";\n\t\tif( this.selectedSchool ) {\n\t\t\turl += \"&structure=\"+this.selectedSchool.id;\n\t\t}\n\t\treturn url;\n\t}\n\n\tprotected get hasManySchools() {\n\t\treturn this.description.schools.length > 1;\n\t}\n\n\tprotected get isStudent():boolean {\n\t\treturn this.me.type===\"ELEVE\";\n\t}\n\tprotected get isTeacher():boolean {\n\t\treturn this.me.type===\"ENSEIGNANT\";\n\t}\n\tprotected get isRelative():boolean {\n\t\treturn this.me.type===\"PERSRELELEVE\";\n\t}\n\tprotected get isPersonnel():boolean {\n\t\treturn this.me.type===\"PERSEDUCNAT\";\n\t}\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./school-widget.widget.html').default;\n\tcontroller = [\"odeThemeHelperService\", Controller];\n\tcontrollerAs = 'ctrl';\n\trequire = ['odeSchoolWidget'];\n\n async link(scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]) {\n const ctrl:Controller|null = controllers ? controllers[0] as Controller : null;\n\t\tif( ! ctrl ) return;\n\n\t\tawait ctrl.initialize();\n\t\tscope.$apply();\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?.detail?.open &&\n\t\t\t\t\t['student.class'\t\t,'student.teachers'\n\t\t\t\t\t,'teacher.students'\t\t,'teacher.teachers'\n\t\t\t\t\t,'relative.teachers'\t,'relative.direction'\n\t\t\t\t\t,'profile'\n\t\t\t\t\t].indexOf(p.detail.open)!==-1 ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.school, 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 school-widget 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 = \"odeSchoolWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeSchoolWidget\", DirectiveFactory );\n"],"names":["themeHelperSvc","session","user","description","avatarUrl","initialize","this","_userPref","WidgetFrameworkFactory","instance","list","find","w","platformConf","name","WIDGET_NAME","SCHOOL","userPref","getBootstrapThemePath","themePath","notif","onSessionReady","promise","defaultIndex","schoolId","isArray","schools","findIndex","school","id","setSelectedSchool","getWidgetStyle","onSchoolSelected","idx","ev","type","which","selectedSchool","saveUserPrefs","length","getDefaultUrl","getUrlTeachersOfMyClass","url","me","classes","getUrlStudentsOfMyClasses","getUrlSchoolTeachers","getUrlTeachersOfMyChildren","getUrlSchoolPersonnels","getUrlSchoolPersonnelsAndTeachers","getUrlStudents","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","$apply","trackEvent","e","p","bubbles","event","detail","open","indexOf","CustomEvent","TrackedActionFromWidget","currentTarget","dispatchEvent","onLangReady","then","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([[142],{7024:(e,t,i)=>{i.d(t,{Z:()=>n});const n=' <div class="widget-header" style="border:0;margin-bottom:-2em"> <div class="subtitle" style="display:none"><i18n>universalis.title</i18n></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"> <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/universalis-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 ng-if="!ctrl.hasManySchools" class="school mb-3">{{ctrl.selectedSchool.name}}</div> <div ng-if="ctrl.hasManySchools" class="dropdown mb-3"> <div class="school-multiple dropdown-toggle" role="button" id="universalisWidgetSchool" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a href="" class="">{{ctrl.selectedSchool.name}}</a> </div> <div class="school-choice dropdown-menu" aria-labelledby="universalisWidgetSchool"> <div tabindex="0" role="button" class="dropdown-item" ng-repeat="school in ctrl.description.schools" ng-click="ctrl.onSchoolSelected($index)" ng-keydown="ctrl.onSchoolSelected($index, $event)"> {{school.name}} </div> </div> </div> <div class="row row-cols-1 align-items-center"> <label class="sr-only" for="inputUniversalisQ" translate content="{{ctrl.selectedSchool.UAI == null ? \'universalis.no.uai\' : \'search\'}}"></label> <div class="input-group mb-2"> <input type="text" id="inputUniversalisQ" class="form-control" name="q" maxlength="255" i18n-placeholder="{{ctrl.selectedSchool.UAI == null ? \'universalis.no.uai\' : \'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> '},462:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(
|
|
1
|
+
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[142],{7024:(e,t,i)=>{i.d(t,{Z:()=>n});const n=' <div class="widget-header" style="border:0;margin-bottom:-2em"> <div class="subtitle" style="display:none"><i18n>universalis.title</i18n></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"> <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/universalis-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 ng-if="!ctrl.hasManySchools" class="school mb-3">{{ctrl.selectedSchool.name}}</div> <div ng-if="ctrl.hasManySchools" class="dropdown mb-3"> <div class="school-multiple dropdown-toggle" role="button" id="universalisWidgetSchool" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a href="" class="">{{ctrl.selectedSchool.name}}</a> </div> <div class="school-choice dropdown-menu" aria-labelledby="universalisWidgetSchool"> <div tabindex="0" role="button" class="dropdown-item" ng-repeat="school in ctrl.description.schools" ng-click="ctrl.onSchoolSelected($index)" ng-keydown="ctrl.onSchoolSelected($index, $event)"> {{school.name}} </div> </div> </div> <div class="row row-cols-1 align-items-center"> <label class="sr-only" for="inputUniversalisQ" translate content="{{ctrl.selectedSchool.UAI == null ? \'universalis.no.uai\' : \'search\'}}"></label> <div class="input-group mb-2"> <input type="text" id="inputUniversalisQ" class="form-control" name="q" maxlength="255" i18n-placeholder="{{ctrl.selectedSchool.UAI == null ? \'universalis.no.uai\' : \'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> '},462:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,s){function r(e){try{c(n.next(e))}catch(e){s(e)}}function l(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,l)}c((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var i,n,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function l(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,n=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],n=0}finally{i=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.odeModuleName=void 0;var r=s(i(4202)),l=i(5262),c=i(9419),a=function(){function e(){}return Object.defineProperty(e.prototype,"description",{get:function(){return(0,c.session)().description},enumerable:!1,configurable:!0}),e.prototype.initialize=function(){var e,t;return n(this,void 0,void 0,function(){var i,n=this;return o(this,function(o){switch(o.label){case 0:return this._userPref=null===(e=l.WidgetFrameworkFactory.instance().list.find(function(e){return e.platformConf.name===l.WIDGET_NAME.UNIVERSALIS}))||void 0===e?void 0:e.userPref,[4,(0,c.notif)().onSessionReady().promise];case 1:return o.sent(),i=0,(null===(t=this._userPref)||void 0===t?void 0:t.schoolId)&&r.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.prototype.onSchoolSelected=function(e,t){var i;return(!t||"keydown"===t.type&&(13===t.which||32===t.which))&&(this._userPref&&this.setSelectedSchool(e)&&(this._userPref.schoolId=null===(i=this.selectedSchool)||void 0===i?void 0:i.id,l.WidgetFrameworkFactory.instance().saveUserPrefs()),!0)},Object.defineProperty(e.prototype,"hasManySchools",{get:function(){return this.description.schools.length>1},enumerable:!1,configurable:!0}),e}(),d=function(){function e(){this.restrict="E",this.template=i(7024).Z,this.scope={},this.bindToController=!0,this.controller=[a],this.controllerAs="ctrl",this.require=["odeUniversalisWidget"]}return e.prototype.link=function(e,t,i,s){return n(this,void 0,void 0,function(){var t;return o(this,function(i){switch(i.label){case 0:return(t=s?s[0]:null)?[4,t.initialize()]:[2];case 1:return i.sent(),e.$apply(),[2]}})})},e}();(0,c.notif)().onLangReady().promise.then(function(e){(0,c.conf)().Platform.idiom.addKeys(i(9899))}),t.odeModuleName="odeUniversalisWidgetModule",r.default.module(t.odeModuleName,[]).directive("odeUniversalisWidget",function(){return new d})},9899:e=>{e.exports=JSON.parse('{"universalis.title":"Universalis","universalis.no.uai":"UAI non renseigné"}')}}]);
|
|
2
2
|
//# sourceMappingURL=universalis-widget.widget.js.map
|