ode-ngjs-front 1.4.19-zookeeper.202512111856 → 1.4.20-develop-b2school.202601061442
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/ts/widgets/carnet-de-bord/carnet-de-bord.widget.d.ts.map +1 -1
- package/dist/ts/widgets/rss-widget/rss-widget.widget.d.ts.map +1 -1
- package/dist/version.txt +1 -1
- package/dist/widgets/carnet-de-bord/carnet-de-bord.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/rss-widget/rss-widget.widget.js +1 -1
- package/dist/widgets/rss-widget/rss-widget.widget.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carnet-de-bord.widget.d.ts","sourceRoot":"","sources":["../../../../src/ts/widgets/carnet-de-bord/carnet-de-bord.widget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"carnet-de-bord.widget.d.ts","sourceRoot":"","sources":["../../../../src/ts/widgets/carnet-de-bord/carnet-de-bord.widget.ts"],"names":[],"mappings":"AA0ZA,eAAO,MAAM,aAAa,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rss-widget.widget.d.ts","sourceRoot":"","sources":["../../../../src/ts/widgets/rss-widget/rss-widget.widget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rss-widget.widget.d.ts","sourceRoot":"","sources":["../../../../src/ts/widgets/rss-widget/rss-widget.widget.ts"],"names":[],"mappings":"AA8QA,eAAO,MAAM,aAAa,uBAAuB,CAAC"}
|
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-ngjs-front
|
|
1
|
+
ode-ngjs-front 06/01/2026 14:43:42
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets/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H,OAAOoI,OAAO7G,EAAE8G,UAAUH,EAAK1G,KAAK,WAEnDoG,GAAcP,EAAKrH,OAAOa,OAAS,IACtCwG,EAAKrG,SAAS,GACC4G,GAAa,EAE9B,GACSX,EAAMqB,QAChB,GACCC,MAAO,SAAChG,GAGK8E,EAAKmB,SADQ,iBAANjG,EACS,CAACkG,MAAMlG,GAEPmG,KAAKC,OAAM,IAAArB,QAAOG,eAAemB,WAE/D,EACD,EACD,EArDA,IAiEA,IAAAC,SAAQC,cAAcC,QAAQvB,KAAM,SAAAlE,IAEzB,IAAAC,QAAOC,SAASC,MAAMuF,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/carnet-de-bord/carnet-de-bord.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/carnet-de-bord/carnet-de-bord.widget.ts"],"sourcesContent":["// Module\nvar code = \" <div class=\\\"widget-dashboard\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"><i18n>carnet-de-bord.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\\\" dnd-nodrag> <div class=\\\"widget-empty-message\\\" ng-if=\\\"ctrl.errorMsg\\\"> <span class=\\\"info\\\" translate content=\\\"[[ctrl.errorMsg.error]]\\\"></span> </div> <div class=\\\"dashboard-choice\\\" ng-if=\\\"!ctrl.errorMsg && ctrl.description.profiles.indexOf('Relative')>=0 && ctrl.eleves.length>0 && ctrl.structures\\\"> <a href=\\\"\\\" class=\\\"avatar-link\\\" ng-repeat=\\\"eleve in ctrl.eleves\\\" ng-click=\\\"ctrl.getEleve($index)\\\" ng-class=\\\"{'active': eleve===ctrl.currentEleve}\\\"> <img ng-src=\\\"[[ctrl.getAvatar($index)]]\\\"/> <span>[[ ctrl.getTag('Prenom', $index) ]]</span> </a> </div> <ul class=\\\"dashboard-list\\\" ng-if=\\\"!ctrl.errorMsg\\\"> <li class=\\\"item link-discret\\\" ng-repeat=\\\"contentType in ctrl.contentTypes\\\" ng-click=\\\"ctrl.openLightBox(contentType, $event)\\\"> <a href=\\\"#\\\" class=\\\"item-inner\\\"> <div class=\\\"left\\\"> <div class=\\\"icon\\\"> <i class=\\\"[[contentType.icon]]\\\"></i> </div> </div> <div class=\\\"right\\\"> <div class=\\\"label\\\" translate content=\\\"carnet-de-bord.widget.[[contentType.title]]\\\"></div> <div class=\\\"info meta\\\" ng-if=\\\"contentType.compact\\\">[[contentType.compact]]</div> <div class=\\\"info meta\\\" ng-if=\\\"!contentType.compact\\\"><i18n>carnet-de-bord.widget.empty</i18n></div> </div> </a> </li> </ul> </div> <ode-modal visible=\\\"ctrl.showLightbox\\\" on-close=\\\"ctrl.showLightbox=false\\\" dnd-nodrag> <ode-modal-title> <span translate content=\\\"[[ctrl.currentContentType.lightboxTitle]]\\\"></span> <span ng-if=\\\"ctrl.me.type !== 'ELEVE' \\\"> <i18n>carnet-de-bord.widget.of</i18n> [[ctrl.getCurrentTag('Prenom')]] </span> </ode-modal-title> <ode-modal-body> <article> <div ng-repeat=\\\"item in ctrl.currentContentType.full\\\"> <p ng-if=\\\"!item.subsections && !item.pageUrl\\\"> <span>•</span>[[ item.value ]] </p> <p ng-if=\\\"!item.subsections && item.pageUrl\\\"> <a target=\\\"_blank\\\" rel=\\\"noopener\\\" href=\\\"[[ctrl.structureAddress]]/[[ctrl.userStatus()]].html?page=[[ item.pageUrl ]]\\\" ng-click=\\\"ctrl.trackEvent($event, {detail:{'open':'any'} })\\\"> <span>•</span>[[ item.value ]] <i class=\\\"new-tab right-magnet\\\" i18n-title=\\\"carnet-de-bord.widget.target.tooltip\\\"></i> </a> </p> <h4 ng-if=\\\"item.subsections && !item.pageUrl\\\"> [[ item.value ]] </h4> <h4 ng-if=\\\"item.subsections && item.pageUrl\\\"> <a target=\\\"_blank\\\" rel=\\\"noopener\\\" href=\\\"[[ctrl.structureAddress]]/[[ctrl.userStatus()]].html?page=[[ item.pageUrl ]]\\\" ng-click=\\\"ctrl.trackEvent($event, {detail:{'open':'any'} })\\\"> [[ item.value ]] <i class=\\\"new-tab right-magnet\\\" i18n-title=\\\"carnet-de-bord.widget.target.tooltip\\\"></i> </a> </h4> <div ng-if=\\\"item.subsections\\\"> <section ng-repeat=\\\"subsection in item.subsections\\\"> <b ng-if=\\\"!subsection.pageUrl\\\">[[ subsection.header ]]</b> <a ng-if=\\\"subsection.pageUrl\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" href=\\\"[[ctrl.structureAddress]]/[[ctrl.userStatus()]].html?page=[[ subsection.pageUrl ]]\\\" ng-click=\\\"ctrl.trackEvent($event, {detail:{'open':'any'} })\\\"> <b>[[ subsection.header ]] <i class=\\\"new-tab right-magnet\\\" i18n-title=\\\"carnet-de-bord.widget.target.tooltip\\\"></i> </b> </a> <br> <span> [[ subsection.content ]] </span> </section> </div> </div> </article> </ode-modal-body> <ode-modal-footer> </ode-modal-footer> </ode-modal> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { L10n, conf, notif, session, http, TrackedAction, TrackedActionFromWidget } from \"../../utils\";\nimport { ILastInfosModel, IUserDescription, IUserInfo } from \"ode-ts-client\";\nimport { ThemeHelperService } from \"../../services\";\n\ninterface IExtendedLastInfosModel extends ILastInfosModel {\n\trelativeDate: string;\n\ttooltip: string;\n}\n\ntype ContentType = {\n\ttitle: string;\t//\"lateness\",\n\ticon: string;\t//\"timer-off\";\n\tcompact: string|boolean;\t//\"\",\n\tfull: any[]|boolean;\n\tlightboxTitle: string;\t//\"carnet-de-bord.widget.lateness.all\"\n}\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tconstructor( \n\t\tprivate themeHelperSvc:ThemeHelperService\n\t) {}\n\tprivate me:IUserInfo = session().user;\n\tprivate description:IUserDescription = session().description;\n\n\tpublic structures:any[] = [];\n\tpublic eleves:any[] = [];\n\t\n\t\n\tpublic showLightbox = false;\n\tpublic currentContentType: any;\n\tpublic currentEleve: any;\n\tpublic contentTypes:ContentType[] = [{\n\t\ttitle: \"lateness\",\n\t\ticon: \"ic-timer-off\",\n\t\tcompact: \"\",\n\t\tfull: [],\n\t\tlightboxTitle: \"carnet-de-bord.widget.lateness.all\"\n\t},{\n\t\ttitle: \"absences\",\n\t\ticon: \"ic-nobody\",\n\t\tcompact: \"\",\n\t\tfull: [],\n\t\tlightboxTitle: \"carnet-de-bord.widget.absences.all\"\n\t},{\n\t\ttitle: \"grades\",\n\t\ticon: \"ic-grades\",\n\t\tcompact: \"\",\n\t\tfull: [],\n\t\tlightboxTitle: \"carnet-de-bord.widget.grades.all\"\n\t},{\n\t\ttitle: \"diary\",\n\t\ticon: \"ic-homeworks\",\n\t\tcompact: \"\",\n\t\tfull: [],\n\t\tlightboxTitle: \"carnet-de-bord.widget.diary.all\"\n\t},{\n\t\ttitle: \"skills\",\n\t\ticon: \"ic-trending-up\",\n\t\tcompact: \"\",\n\t\tfull: [],\n\t\tlightboxTitle: \"carnet-de-bord.widget.skills.all\"\n\t}];\n public structureAddress:string = \"\";\n public structureId:string = \"\";\n public parentTag?:JQuery<HTMLElement>;\n public errorMsg:any;\n\t\n\tgetAvatar(index:number):string {\n\t\tif (index < this.eleves.length) {\n\t\t\treturn `/userbook/avatar/${this.getChildId(index)}?thumbnail=100x100`;\n\t\t} else {\n\t\t\treturn this.themeHelperSvc.toSkinUrl(\"/img/illustrations/no-avatar.svg?thumbnail=100x100\");\n\t\t}\n\t}\n\n\tgetEleve(index:number){\n\t\tif (index < this.eleves.length) {\n\t\t\tthis.currentEleve = this.eleves[index];\n\t\t\tthis.contentTypes.forEach( (type:ContentType) => {\n\t\t\t\tthis.getContent( type, this.currentEleve );\n\t\t\t});\n\t\t}\n\t}\n\n\tgetTag(tagName:string, index:number){\n\t\tif (index < this.eleves.length) {\n\t\t\treturn $(this.eleves[index]).find(tagName).text();\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tgetCurrentTag(tagName:string){\n\t\tif (this.currentEleve) {\n\t\t\treturn $(this.currentEleve).find(tagName).text();\n\t\t}\n\t\treturn \"\";\n\t}\n\n userStatus(){\n if (this.me.type === 'PERSRELELEVE') {\n return 'parent';\n } else if (this.me.type === 'ELEVE') {\n return 'eleve';\n } else {\n return '';\n }\n }\n\t\n\tgetChildId( index:number ){\n\t\tconst xmlFirstName = this.getTag('Prenom', index).toLowerCase();\n\t\tconst xmlLastName = this.getTag('Nom', index).toLowerCase();\n\t\tfor( let id in this.me.children ){\n\t\t\tconst modelFname = this.me.children[id].firstName.toLowerCase();\n\t\t\tconst modelLname = this.me.children[id].lastName.toLowerCase();\n\t\n\t\t if(modelFname === xmlFirstName && modelLname === xmlLastName){\n\t\t\t return id;\n\t\t }\n\t\t}\n\t}\n\n\topenLightBox(contentType:any, e:Event){\n\t\tthis.currentContentType = contentType;\n\t\tthis.showLightbox = true;\n\n // Track this event.\n if( e.currentTarget ) {\n this.trackEvent(e, { detail:{'properties':'any'} });\n }\n\t}\n\n // Give an opportunity to track some events from outside of this component.\n protected trackEvent(e:Event, p:CustomEventInit<TrackedAction>) {\n // Allow events to bubble up.\n if(typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n let event = null;\n if( p && (typeof p.detail?.open==='string'||typeof p.detail?.properties==='string') ) {\n event = new CustomEvent( TrackedActionFromWidget.carnetDeBord, p );\n }\n if( event && e.currentTarget ) {\n e.currentTarget.dispatchEvent(event);\n }\n }\n\n\tprivate getContent( contentType:ContentType, eleve:any ) {\n\t\tconst lang = conf().Platform.idiom;\n\t\tif( contentType.title === 'lateness' ) {\n\t\t\tlet delays = $(eleve).find('Retard Justifie');\n\t\t\tlet latedate:any = false;\n\t\t\tconst allDelays = [] as any[];\n\t\t\tcontentType.compact = false;\n\t\t\tcontentType.full = false;\n\n\t\t\tif (delays) {\n\t\t\t\tdelays.each( (i, delay) => {\n\t\t\t\t\tif($(delay).text() === 'false'){\n\t\t\t\t\t\tvar pageUrl = $(delay).parent().attr('page');\n\t\t\t\t\t\tlatedate = $(delay).parent().find('Date').text();\n\t\t\t\t\t\tlatedate = L10n.moment(latedate);\n\t\t\t\t\t\tlatedate = lang.translate('carnet-de-bord.widget.the')+\" \"+latedate.format('DD/MM/YYYY - HH:mm');\n\t\t\t\t\t\tallDelays.push({\n\t\t\t\t\t\t\tvalue : latedate,\n\t\t\t\t\t\t\tpageUrl : pageUrl\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontentType.compact = allDelays[0].value;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tcontentType.full = allDelays;\n\t\t\t}\n\t\t} else if( contentType.title === 'absences' ) {\n var allAbsences:any[] = [];\n contentType.compact = false;\n contentType.full = false;\n\n var absences = $(eleve).find('Absence Justifie')\n\n if(absences){\n absences.each(function(i, absence){\n\n if($(absence).text() === 'false'){\n\n var pageUrl = $(absence).parent().attr('page');\n\n\t\t\t\t\t\tlet absDate:any;\n\n if($(absence).parent().find('EstOuverte').text()===\"false\"){\n // du... au...\n let startdate:any = $(absence).parent().find('DateDebut').text();\n let enddate:any = $(absence).parent().find('DateFin').text();\n startdate = L10n.moment(startdate);\n enddate = L10n.moment(enddate);\n startdate = startdate.format('DD/MM/YYYY HH:mm');\n enddate = enddate.format('DD/MM/YYYY HH:mm');\n\n absDate = lang.translate('carnet-de-bord.widget.from')+\" \"+startdate +\" \"+lang.translate('carnet-de-bord.widget.to')+\" \"+enddate;\n }else {\n absDate = $(absence).parent().find('DateDebut').text();\n absDate = L10n.moment(absDate);\n absDate = absDate.format('DD/MM/YYYY HH:mm');\n absDate = lang.translate('carnet-de-bord.widget.the')+\" \"+ absDate;\n }\n allAbsences.push({\n value : absDate,\n pageUrl : pageUrl\n });\n contentType.compact = allAbsences[0].value\n }\n })\n contentType.full = allAbsences;\n }\n\t\t} else if( contentType.title === 'grades' ) {\n var allGrades:any[] = [];\n contentType.compact = false;\n contentType.full = false;\n\n var isnote = $(eleve).find('PageReleveDeNotes Devoir Note').text();\n if(isnote){\n var lastNotes = $(eleve).find('PageReleveDeNotes Devoir')\n\n lastNotes.each(function(i, result){\n var pageUrl = $(result).attr('page');\n var note = $(result).find('Note').text();\n var bareme = $(result).find('Bareme').text();\n var matiere = $(result).find('Matiere').text();\n var notedate:any = L10n.moment($(result).find('Date').text());\n notedate = notedate.format('DD/MM/YYYY');\n var grade = note+\"/\"+bareme+\" \"+lang.translate('carnet-de-bord.widget.in')+\" \"+matiere+\" \"+lang.translate('carnet-de-bord.widget.the')+\" \"+notedate;\n\n allGrades.push({\n value : grade,\n pageUrl : pageUrl\n });\n contentType.compact = allGrades[0].value\n\n })\n contentType.full = allGrades\n }\n\n } else if( contentType.title === 'diary' ) {\n var allWorks:any[] = [];\n contentType.compact = false;\n contentType.full = false;\n\n var iswork = $(eleve).find('PageCahierDeTextes CahierDeTextes TravailAFaire Descriptif').text();\n if (iswork) {\n const parser = new DOMParser();\n var diaries = $(eleve).find('PageCahierDeTextes CahierDeTextes');\n $(diaries).each(function(i, diary){\n if ($(diary).find('TravailAFaire Descriptif').text()) {\n\n let matiere = lang.translate('carnet-de-bord.widget.new.homework')+\" \"+$(diary).find('Matiere').text()\n let works = $(diary).find('TravailAFaire');\n let subsections:any[] = [];\n\n $(works).each(function(i, work){\n let pageUrl = $(work).attr('page');\n let matiereFirst = $(work).parent().find('Matiere').text()\n let delivdate:any = L10n.moment($(work).find('PourLe').text())\n delivdate = delivdate.format('DD/MM/YYYY');\n delivdate = lang.translate('carnet-de-bord.widget.for')+\" \"+delivdate\n let descr:any = $(work).find('Descriptif');\n //can throw a DOMException\n //descr = descr.html(descr.text()).text();\n const doc = parser.parseFromString(descr.text(), 'text/html');\n descr = doc.documentElement.textContent;\n\n subsections.push({\n header: delivdate,\n content: descr,\n pageUrl: pageUrl\n })\n })\n\n allWorks.push({\n value: matiere,\n subsections: subsections\n });\n contentType.compact = allWorks[0].value+\" \"+allWorks[0].subsections[0].header\n }\n })\n\n contentType.full = allWorks\n }\n } else if( contentType.title === 'skills' ) {\n let allSkills:any[] = [];\n let subsections:any[] = [];\n contentType.compact = false;\n contentType.full = false;\n\n var isSkill = $(eleve).find('PageCompetences Competence').text();\n\n if (isSkill) {\n var skills = $(eleve).find('PageCompetences Competence').parent()\n skills.each(function(i, skill){\n if ($(skill).find('Libelle').text()===\"Acquis\") {\n var pageUrl = $(skill).attr('page');\n var title = $(skill).find('Intitule').text();\n var competence = $(skill).find('Competence').text()+\" \";\n var item = $(skill).find('Item').text()+\" \";\n\n var matiere = $(skill).find('Matiere').text();\n var skillDate:any = L10n.moment($(skill).find('Date').text());\n skillDate = skillDate.format('DD/MM/YYYY');\n\n var headskill = lang.translate('carnet-de-bord.widget.skills')+\" \";\n var headitem = lang.translate('carnet-de-bord.widget.skills.item')+\" \";\n\n var fullTitle = title +\" \"+lang.translate('carnet-de-bord.widget.the')+\" \"+skillDate;\n\n if(matiere){\n fullTitle = fullTitle+\" \"+lang.translate('carnet-de-bord.widget.in')+\" \"+matiere;\n }\n\n var subsections = [{\n header: headskill,\n content: competence\n }];\n\n if($(skill).find('Item').text()){\n subsections.push({\n header: headitem,\n content: item\n })\n }\n allSkills.push({\n value: fullTitle,\n subsections: subsections,\n pageUrl: pageUrl\n });\n contentType.compact = allSkills[0].value;\n }\n })\n contentType.full = allSkills;\n }\n }\n\t}\n}\n\n/* Directive */\nclass Directive implements IDirective<IScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./carnet-de-bord.widget.html').default;\n\tcontroller = [\"odeThemeHelperService\", Controller];\n\tcontrollerAs = 'ctrl';\n require = ['odeCarnetDeBord'];\n\n link(scope:IScope, 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\thttp().get('/sso/pronote')\n\t\t.then( (structures:any[]) => {\n if( http().latestResponse.status !== 200 ) {\n /* Mocked data for testing during development.\n structures = [{\n \"structureId\" : null,\n \"xmlResponse\" : \"<?xml version=\\\"1.0\\\"?>\\r\\n<Parent xmlns=\\\"http://www.index-education.com/accueilENT\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.index-education.com/accueilENT Parent.xsd\\\" version=\\\"1.03\\\"><Eleve><Nom>BESNIER</Nom><Prenom>Amelie</Prenom><IdentifiantPronote>74CPUWN8RAJQVM5K</IdentifiantPronote><PageReleveDeNotes><Titre>Relevé de notes<\\/Titre><Message>Publication du bulletin le 20\\/02<\\/Message><Devoir page=\\\"da89cbc9e593f9c4273356659410b0780a616fc5b398d64ba174e138ae0fd5adb4c4b787aa38a237966c8478db61faea\\\"><Note>15,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>TECHNOLOGIE<\\/Matiere><Date>2012-03-26<\\/Date><\\/Devoir><Devoir><Note>17,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>NOTE DE VIE SCOLAIRE<\\/Matiere><Date>2012-03-26<\\/Date><\\/Devoir><Devoir><Note>14,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>ALLEMAND LV2<\\/Matiere><Date>2012-03-25<\\/Date><\\/Devoir><\\/PageReleveDeNotes><PageCahierDeTextes><Titre>Travaux \\u00E0 faire<\\/Titre><CahierDeTextes><Matiere>MATHEMATIQUE<\\/Matiere><Date>2012-03-24<\\/Date><TravailAFaire><Descriptif>Lire et apprendre<\\/Descriptif><PourLe>2012-03-25<\\/PourLe><PieceJointe>2 géométrie, fonctions.doc?sessionENT=20200<\\/PieceJointe><SiteInternet>http:\\/\\/www.google.com<\\/SiteInternet><\\/TravailAFaire><\\/CahierDeTextes><\\/PageCahierDeTextes><PageVieScolaire><Titre>Vie scolaire</Titre><Absence page=\\\"72DF243042E894648C14FB0D5D1EE3081D1E004C8F652CBDA731EEB8BD00ED2DAFCDB4EF61078786E411BFD357C4E35922C97134B3A119EB2F49DCE79E38168F\\\"><DateDebut>2016-09-20T08:00:00</DateDebut><DateFin>2016-09-20T09:00:00</DateFin><EstOuverte>false</EstOuverte><Justifie>false</Justifie><Motif></Motif></Absence></PageVieScolaire></Eleve><Eleve><Nom>BESNIER</Nom><Prenom>Marie</Prenom><IdentifiantPronote>X5VKRNQ9W7MHA4SU</IdentifiantPronote><PageReleveDeNotes><Titre>Relevé de notes<\\/Titre><Message>Publication du bulletin le 20\\/02<\\/Message><Devoir page=\\\"da89cbc9e593f9c4273356659410b0780a616fc5b398d64ba174e138ae0fd5adb4c4b787aa38a237966c8478db61faea\\\"><Note>15,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>TECHNOLOGIE<\\/Matiere><Date>2012-03-26<\\/Date><\\/Devoir><Devoir><Note>17,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>NOTE DE VIE SCOLAIRE<\\/Matiere><Date>2012-03-26<\\/Date><\\/Devoir><Devoir><Note>14,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>ALLEMAND LV2<\\/Matiere><Date>2012-03-25<\\/Date><\\/Devoir><\\/PageReleveDeNotes><PageCompetences><Titre>Compétences</Titre><Item page=\\\"FC560506B53C466323C3BB6495BA0C3DD788475225004AE89B4B662475B2F533614EF0A1574E1DA7DFA4FCF0A893C7C9DC5ADABABB04084A0504CED0FE06CF25B8C36ADDC1F5451527B117A97425276A\\\"><Competence>Langue française à l'oral et à l'écrit</Competence><Intitule>Résumer un texte</Intitule><NiveauDAcquisition><Genre>2</Genre><Libelle>Acquis</Libelle></NiveauDAcquisition><Date>2016-09-21</Date></Item><Item page=\\\"FC560506B53C466323C3BB6495BA0C3DD788475225004AE89B4B662475B2F533614EF0A1574E1DA7DFA4FCF0A893C7C9DC5ADABABB04084A0504CED0FE06CF25B8C36ADDC1F5451527B117A97425276A\\\"><Competence>Langue française à l'oral et à l'écrit</Competence><Intitule>Adapter le propos au destinataire et à l’effet recherché</Intitule><NiveauDAcquisition><Genre>2</Genre><Libelle>Acquis</Libelle></NiveauDAcquisition><Date>2016-09-21</Date></Item><Item page=\\\"FC560506B53C466323C3BB6495BA0C3DD788475225004AE89B4B662475B2F533614EF0A1574E1DA7DFA4FCF0A893C7C9DC5ADABABB04084A0504CED0FE06CF25B8C36ADDC1F5451527B117A97425276A\\\"><Competence>Langue française à l'oral et à l'écrit</Competence><Intitule>Utiliser les principales règles d’orthographe lexicale et grammaticale</Intitule><NiveauDAcquisition><Genre>2</Genre><Libelle>Acquis</Libelle></NiveauDAcquisition><Date>2016-09-21</Date></Item><Item page=\\\"FC560506B53C466323C3BB6495BA0C3DD788475225004AE89B4B662475B2F533614EF0A1574E1DA7DFA4FCF0A893C7C9DC5ADABABB04084A0504CED0FE06CF25B8C36ADDC1F5451527B117A97425276A\\\"><Competence>Langue française à l'oral et à l'écrit</Competence><Intitule>Rédiger un texte bref, cohérent, construit en paragraphes, correctement ponctué, en respectant des consignes imposées : récit, description, explication, texte argumentatif, compte rendu, écrits courants (lettres, …)</Intitule><NiveauDAcquisition><Genre>2</Genre><Libelle>Acquis</Libelle></NiveauDAcquisition><Date>2016-09-21</Date></Item><Item page=\\\"FC560506B53C466323C3BB6495BA0C3DD788475225004AE89B4B662475B2F533614EF0A1574E1DA7DFA4FCF0A893C7C9DC5ADABABB04084A0504CED0FE06CF25B8C36ADDC1F5451527B117A97425276A\\\"><Competence>Langue française à l'oral et à l'écrit</Competence><Intitule>Répondre à une question par une phrase complète</Intitule><NiveauDAcquisition><Genre>2</Genre><Libelle>Acquis</Libelle></NiveauDAcquisition><Date>2016-09-21</Date></Item></PageCompetences><PageCahierDeTextes><Titre>Cahier de textes</Titre></PageCahierDeTextes><PageVieScolaire><Titre>Vie scolaire</Titre><Absence page=\\\"914686157E0EC40CF0E0E5F762886F121D1E004C8F652CBDA731EEB8BD00ED2D73787C8D4D7E599A35A8B1A97BFE8E51587812524363C51E86538C2E7DB934C6\\\"><DateDebut>2016-09-21T08:00:00</DateDebut><DateFin>2016-09-21T09:00:00</DateFin><EstOuverte>false</EstOuverte><Justifie>false</Justifie><Motif></Motif></Absence><Absence page=\\\"914686157E0EC40CF0E0E5F762886F121D1E004C8F652CBDA731EEB8BD00ED2D73787C8D4D7E599A35A8B1A97BFE8E51587812524363C51E86538C2E7DB934C6\\\"><DateDebut>2016-09-21T08:00:00</DateDebut><DateFin>2016-09-21T09:00:00</DateFin><EstOuverte>false</EstOuverte><Justifie>true</Justifie><Motif></Motif></Absence><Absence page=\\\"914686157E0EC40CF0E0E5F762886F121D1E004C8F652CBDA731EEB8BD00ED2D73787C8D4D7E599A35A8B1A97BFE8E51587812524363C51E86538C2E7DB934C6\\\"><DateDebut>2016-09-22T08:00:00</DateDebut><DateFin></DateFin><EstOuverte>true</EstOuverte><Justifie>false</Justifie><Motif></Motif></Absence><Retard page=\\\"914686157E0EC40CF0E0E5F762886F121D1E004C8F652CBDA731EEB8BD00ED2D73787C8D4D7E599A35A8B1A97BFE8E51587812524363C51E86538C2E7DB934C6\\\"><Date>2016-09-23T08:00:00</Date><Justifie>true</Justifie><Motif></Motif></Retard><Retard page=\\\"914686157E0EC40CF0E0E5F762886F121D1E004C8F652CBDA731EEB8BD00ED2D73787C8D4D7E599A35A8B1A97BFE8E51587812524363C51E86538C2E7DB934C6\\\"><Date>2016-09-24T08:00:00</Date><Justifie>false</Justifie><Motif></Motif></Retard></PageVieScolaire></Eleve><PageMessagerie><Titre>Messagerie</Titre><Discussions page=\\\"81C70AC5418CE75797C2C7B44181715FA2CA23E7B1634350133911009499746D\\\"><NombreMessagesNonLus>0</NombreMessagesNonLus></Discussions><Informations page=\\\"62962842B1203FD963629E4DC8294206CFC0BCED2CDD00E466FC2436F64DBC81\\\"><NombreInformationsNonLus>0</NombreInformationsNonLus></Informations></PageMessagerie></Parent>\\r\\n\",\n \"address\" : \"https://WSEducation.index-education.net/pronote\" \n }];\n */\n throw \"carnet-de-bord.widget.pronote.access.error\";\n }\n if( !angular.isArray(structures) ) {\n throw \"carnet-de-bord.widget.nodata\";\n }\n\t\t\tctrl.structures = structures;\n\t\t\tctrl.eleves = [];\n let firstEleve:boolean = true;\n\t\t\tstructures.forEach( structure => {\n\t\t\t\tctrl.structureAddress = structure.address;\n\t\t\t\tctrl.structureId = structure.structureId;\n\t\t\t\tvar xmlDocument = $.parseXML(structure.xmlResponse);\n\t\t\t\tvar $xml = $(xmlDocument);\n\t\t\t\tctrl.parentTag = $xml.find('Parent');\n\t\t\t\tctrl.eleves = ctrl.eleves.concat($.makeArray($xml.find('Eleve')));\n\t\t\t\t//console.log(widget.eleves);\n\t\t\t\tif( firstEleve && ctrl.eleves.length > 0 ){\n\t\t\t\t\tctrl.getEleve(0);\n firstEleve = false;\n\t\t\t\t}\n\t\t\t});\n scope.$apply();\n\t\t})\n\t\t.catch( (e) => {\n // FIXME : format of error messages ?\n if( typeof e === \"string\" ) {\n ctrl.errorMsg = {error:e};\n } else {\n ctrl.errorMsg = JSON.parse(http().latestResponse.statusText);\n }\n\t\t});\t\t\n\t}\n}\n\n/** The carnet-de-bord widget.\n *\n * Usage:\n * <ode-carnet-de-bord></ode-carnet-de-bord>\n */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then( lang => {\n\tswitch( lang ) {\n\t\tdefault:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n\t}\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeCarnetDeBordModule\";\nangular.module( odeModuleName, []).directive( \"odeCarnetDeBord\", DirectiveFactory );\n"],"names":["themeHelperSvc","me","session","user","description","structures","eleves","showLightbox","contentTypes","title","icon","compact","full","lightboxTitle","structureAddress","structureId","getAvatar","index","this","length","getChildId","toSkinUrl","getEleve","currentEleve","forEach","type","getContent","getTag","tagName","$","find","text","getCurrentTag","userStatus","xmlFirstName","toLowerCase","xmlLastName","id","children","modelFname","firstName","modelLname","lastName","openLightBox","contentType","e","currentContentType","currentTarget","trackEvent","detail","p","bubbles","event","open","properties","CustomEvent","TrackedActionFromWidget","carnetDeBord","dispatchEvent","eleve","lang","conf","Platform","idiom","delays","each","i","delay","pageUrl","parent","attr","L10n","moment","translate","format","push","value","allAbsences","absences","absence","absDate","startdate","enddate","allGrades","result","note","bareme","matiere","notedate","grade","allWorks","DOMParser","diaries","diary","works","work","delivdate","descr","doc","parseFromString","documentElement","textContent","header","content","subsections","skill","competence","item","skillDate","headskill","headitem","fullTitle","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","http","get","then","latestResponse","status","isArray","firstEleve","structure","address","xmlDocument","parseXML","xmlResponse","$xml","parentTag","concat","makeArray","$apply","catch","errorMsg","error","JSON","parse","statusText","notif","onLangReady","promise","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"widgets/carnet-de-bord/carnet-de-bord.widget.js","mappings":"gIAGA,QAFW,8zG,mLCDX,iBACA,UAaA,aACC,WACSA,GAAA,KAAAA,eAAAA,EAED,KAAAC,IAAe,IAAAC,WAAUC,KACzB,KAAAC,aAA+B,IAAAF,WAAUE,YAE1C,KAAAC,WAAmB,GACnB,KAAAC,OAAe,GAGf,KAAAC,cAAe,EAGf,KAAAC,aAA6B,CAAC,CACpCC,MAAO,WACPC,KAAM,eACNC,QAAS,GACTC,KAAM,GACNC,cAAe,sCACd,CACDJ,MAAO,WACPC,KAAM,YACNC,QAAS,GACTC,KAAM,GACNC,cAAe,sCACd,CACDJ,MAAO,SACPC,KAAM,YACNC,QAAS,GACTC,KAAM,GACNC,cAAe,oCACd,CACDJ,MAAO,QACPC,KAAM,eACNC,QAAS,GACTC,KAAM,GACNC,cAAe,mCACd,CACDJ,MAAO,SACPC,KAAM,iBACNC,Q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","webpack://ode-ngjs-front/./src/ts/widgets/carnet-de-bord/carnet-de-bord.widget.ts"],"sourcesContent":["// Module\nvar code = \" <div class=\\\"widget-dashboard\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"><i18n>carnet-de-bord.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\\\" dnd-nodrag> <div class=\\\"widget-empty-message\\\" ng-if=\\\"ctrl.errorMsg\\\"> <span class=\\\"info\\\" translate content=\\\"[[ctrl.errorMsg.error]]\\\"></span> </div> <div class=\\\"dashboard-choice\\\" ng-if=\\\"!ctrl.errorMsg && ctrl.description.profiles.indexOf('Relative')>=0 && ctrl.eleves.length>0 && ctrl.structures\\\"> <a href=\\\"\\\" class=\\\"avatar-link\\\" ng-repeat=\\\"eleve in ctrl.eleves\\\" ng-click=\\\"ctrl.getEleve($index)\\\" ng-class=\\\"{'active': eleve===ctrl.currentEleve}\\\"> <img ng-src=\\\"[[ctrl.getAvatar($index)]]\\\"/> <span>[[ ctrl.getTag('Prenom', $index) ]]</span> </a> </div> <ul class=\\\"dashboard-list\\\" ng-if=\\\"!ctrl.errorMsg\\\"> <li class=\\\"item link-discret\\\" ng-repeat=\\\"contentType in ctrl.contentTypes\\\" ng-click=\\\"ctrl.openLightBox(contentType, $event)\\\"> <a href=\\\"#\\\" class=\\\"item-inner\\\"> <div class=\\\"left\\\"> <div class=\\\"icon\\\"> <i class=\\\"[[contentType.icon]]\\\"></i> </div> </div> <div class=\\\"right\\\"> <div class=\\\"label\\\" translate content=\\\"carnet-de-bord.widget.[[contentType.title]]\\\"></div> <div class=\\\"info meta\\\" ng-if=\\\"contentType.compact\\\">[[contentType.compact]]</div> <div class=\\\"info meta\\\" ng-if=\\\"!contentType.compact\\\"><i18n>carnet-de-bord.widget.empty</i18n></div> </div> </a> </li> </ul> </div> <ode-modal visible=\\\"ctrl.showLightbox\\\" on-close=\\\"ctrl.showLightbox=false\\\" dnd-nodrag> <ode-modal-title> <span translate content=\\\"[[ctrl.currentContentType.lightboxTitle]]\\\"></span> <span ng-if=\\\"ctrl.me.type !== 'ELEVE' \\\"> <i18n>carnet-de-bord.widget.of</i18n> [[ctrl.getCurrentTag('Prenom')]] </span> </ode-modal-title> <ode-modal-body> <article> <div ng-repeat=\\\"item in ctrl.currentContentType.full\\\"> <p ng-if=\\\"!item.subsections && !item.pageUrl\\\"> <span>•</span>[[ item.value ]] </p> <p ng-if=\\\"!item.subsections && item.pageUrl\\\"> <a target=\\\"_blank\\\" rel=\\\"noopener\\\" href=\\\"[[ctrl.structureAddress]]/[[ctrl.userStatus()]].html?page=[[ item.pageUrl ]]\\\" ng-click=\\\"ctrl.trackEvent($event, {detail:{'open':'any'} })\\\"> <span>•</span>[[ item.value ]] <i class=\\\"new-tab right-magnet\\\" i18n-title=\\\"carnet-de-bord.widget.target.tooltip\\\"></i> </a> </p> <h4 ng-if=\\\"item.subsections && !item.pageUrl\\\"> [[ item.value ]] </h4> <h4 ng-if=\\\"item.subsections && item.pageUrl\\\"> <a target=\\\"_blank\\\" rel=\\\"noopener\\\" href=\\\"[[ctrl.structureAddress]]/[[ctrl.userStatus()]].html?page=[[ item.pageUrl ]]\\\" ng-click=\\\"ctrl.trackEvent($event, {detail:{'open':'any'} })\\\"> [[ item.value ]] <i class=\\\"new-tab right-magnet\\\" i18n-title=\\\"carnet-de-bord.widget.target.tooltip\\\"></i> </a> </h4> <div ng-if=\\\"item.subsections\\\"> <section ng-repeat=\\\"subsection in item.subsections\\\"> <b ng-if=\\\"!subsection.pageUrl\\\">[[ subsection.header ]]</b> <a ng-if=\\\"subsection.pageUrl\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" href=\\\"[[ctrl.structureAddress]]/[[ctrl.userStatus()]].html?page=[[ subsection.pageUrl ]]\\\" ng-click=\\\"ctrl.trackEvent($event, {detail:{'open':'any'} })\\\"> <b>[[ subsection.header ]] <i class=\\\"new-tab right-magnet\\\" i18n-title=\\\"carnet-de-bord.widget.target.tooltip\\\"></i> </b> </a> <br> <span> [[ subsection.content ]] </span> </section> </div> </div> </article> </ode-modal-body> <ode-modal-footer> </ode-modal-footer> </ode-modal> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { L10n, conf, notif, session, http, TrackedAction, TrackedActionFromWidget } from \"../../utils\";\nimport { IUserDescription, IUserInfo } from \"ode-ts-client\";\nimport { ThemeHelperService } from \"../../services\";\n\ntype ContentType = {\n\ttitle: string;\t//\"lateness\",\n\ticon: string;\t//\"timer-off\";\n\tcompact: string|boolean;\t//\"\",\n\tfull: any[]|boolean;\n\tlightboxTitle: string;\t//\"carnet-de-bord.widget.lateness.all\"\n}\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tconstructor( \n\t\tprivate themeHelperSvc:ThemeHelperService\n\t) {}\n\tprivate me:IUserInfo = session().user;\n\tprivate description:IUserDescription = session().description;\n\n\tpublic structures:any[] = [];\n\tpublic eleves:any[] = [];\n\t\n\t\n\tpublic showLightbox = false;\n\tpublic currentContentType: any;\n\tpublic currentEleve: any;\n\tpublic contentTypes:ContentType[] = [{\n\t\ttitle: \"lateness\",\n\t\ticon: \"ic-timer-off\",\n\t\tcompact: \"\",\n\t\tfull: [],\n\t\tlightboxTitle: \"carnet-de-bord.widget.lateness.all\"\n\t},{\n\t\ttitle: \"absences\",\n\t\ticon: \"ic-nobody\",\n\t\tcompact: \"\",\n\t\tfull: [],\n\t\tlightboxTitle: \"carnet-de-bord.widget.absences.all\"\n\t},{\n\t\ttitle: \"grades\",\n\t\ticon: \"ic-grades\",\n\t\tcompact: \"\",\n\t\tfull: [],\n\t\tlightboxTitle: \"carnet-de-bord.widget.grades.all\"\n\t},{\n\t\ttitle: \"diary\",\n\t\ticon: \"ic-homeworks\",\n\t\tcompact: \"\",\n\t\tfull: [],\n\t\tlightboxTitle: \"carnet-de-bord.widget.diary.all\"\n\t},{\n\t\ttitle: \"skills\",\n\t\ticon: \"ic-trending-up\",\n\t\tcompact: \"\",\n\t\tfull: [],\n\t\tlightboxTitle: \"carnet-de-bord.widget.skills.all\"\n\t}];\n public structureAddress:string = \"\";\n public structureId:string = \"\";\n public parentTag?:JQuery<HTMLElement>;\n public errorMsg:any;\n\t\n\tgetAvatar(index:number):string {\n\t\tif (index < this.eleves.length) {\n\t\t\treturn `/userbook/avatar/${this.getChildId(index)}?thumbnail=100x100`;\n\t\t} else {\n\t\t\treturn this.themeHelperSvc.toSkinUrl(\"/img/illustrations/no-avatar.svg?thumbnail=100x100\");\n\t\t}\n\t}\n\n\tgetEleve(index:number){\n\t\tif (index < this.eleves.length) {\n\t\t\tthis.currentEleve = this.eleves[index];\n\t\t\tthis.contentTypes.forEach( (type:ContentType) => {\n\t\t\t\tthis.getContent( type, this.currentEleve );\n\t\t\t});\n\t\t}\n\t}\n\n\tgetTag(tagName:string, index:number){\n\t\tif (index < this.eleves.length) {\n\t\t\treturn $(this.eleves[index]).find(tagName).text();\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tgetCurrentTag(tagName:string){\n\t\tif (this.currentEleve) {\n\t\t\treturn $(this.currentEleve).find(tagName).text();\n\t\t}\n\t\treturn \"\";\n\t}\n\n userStatus(){\n if (this.me.type === 'PERSRELELEVE') {\n return 'parent';\n } else if (this.me.type === 'ELEVE') {\n return 'eleve';\n } else {\n return '';\n }\n }\n\t\n\tgetChildId( index:number ){\n\t\tconst xmlFirstName = this.getTag('Prenom', index).toLowerCase();\n\t\tconst xmlLastName = this.getTag('Nom', index).toLowerCase();\n\t\tfor( let id in this.me.children ){\n\t\t\tconst modelFname = this.me.children[id].firstName.toLowerCase();\n\t\t\tconst modelLname = this.me.children[id].lastName.toLowerCase();\n\t\n\t\t if(modelFname === xmlFirstName && modelLname === xmlLastName){\n\t\t\t return id;\n\t\t }\n\t\t}\n\t}\n\n\topenLightBox(contentType:any, e:Event){\n\t\tthis.currentContentType = contentType;\n\t\tthis.showLightbox = true;\n\n // Track this event.\n if( e.currentTarget ) {\n this.trackEvent(e, { detail:{'properties':'any'} });\n }\n\t}\n\n // Give an opportunity to track some events from outside of this component.\n protected trackEvent(e:Event, p:CustomEventInit<TrackedAction>) {\n // Allow events to bubble up.\n if(typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n let event = null;\n if( p && (typeof p.detail?.open==='string'||typeof p.detail?.properties==='string') ) {\n event = new CustomEvent( TrackedActionFromWidget.carnetDeBord, p );\n }\n if( event && e.currentTarget ) {\n e.currentTarget.dispatchEvent(event);\n }\n }\n\n\tprivate getContent( contentType:ContentType, eleve:any ) {\n\t\tconst lang = conf().Platform.idiom;\n\t\tif( contentType.title === 'lateness' ) {\n\t\t\tlet delays = $(eleve).find('Retard Justifie');\n\t\t\tlet latedate:any = false;\n\t\t\tconst allDelays = [] as any[];\n\t\t\tcontentType.compact = false;\n\t\t\tcontentType.full = false;\n\n\t\t\tif (delays) {\n\t\t\t\tdelays.each( (i, delay) => {\n\t\t\t\t\tif($(delay).text() === 'false'){\n\t\t\t\t\t\tvar pageUrl = $(delay).parent().attr('page');\n\t\t\t\t\t\tlatedate = $(delay).parent().find('Date').text();\n\t\t\t\t\t\tlatedate = L10n.moment(latedate);\n\t\t\t\t\t\tlatedate = lang.translate('carnet-de-bord.widget.the')+\" \"+latedate.format('DD/MM/YYYY - HH:mm');\n\t\t\t\t\t\tallDelays.push({\n\t\t\t\t\t\t\tvalue : latedate,\n\t\t\t\t\t\t\tpageUrl : pageUrl\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontentType.compact = allDelays[0].value;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tcontentType.full = allDelays;\n\t\t\t}\n\t\t} else if( contentType.title === 'absences' ) {\n var allAbsences:any[] = [];\n contentType.compact = false;\n contentType.full = false;\n\n var absences = $(eleve).find('Absence Justifie')\n\n if(absences){\n absences.each(function(i, absence){\n\n if($(absence).text() === 'false'){\n\n var pageUrl = $(absence).parent().attr('page');\n\n\t\t\t\t\t\tlet absDate:any;\n\n if($(absence).parent().find('EstOuverte').text()===\"false\"){\n // du... au...\n let startdate:any = $(absence).parent().find('DateDebut').text();\n let enddate:any = $(absence).parent().find('DateFin').text();\n startdate = L10n.moment(startdate);\n enddate = L10n.moment(enddate);\n startdate = startdate.format('DD/MM/YYYY HH:mm');\n enddate = enddate.format('DD/MM/YYYY HH:mm');\n\n absDate = lang.translate('carnet-de-bord.widget.from')+\" \"+startdate +\" \"+lang.translate('carnet-de-bord.widget.to')+\" \"+enddate;\n }else {\n absDate = $(absence).parent().find('DateDebut').text();\n absDate = L10n.moment(absDate);\n absDate = absDate.format('DD/MM/YYYY HH:mm');\n absDate = lang.translate('carnet-de-bord.widget.the')+\" \"+ absDate;\n }\n allAbsences.push({\n value : absDate,\n pageUrl : pageUrl\n });\n contentType.compact = allAbsences[0].value\n }\n })\n contentType.full = allAbsences;\n }\n\t\t} else if( contentType.title === 'grades' ) {\n var allGrades:any[] = [];\n contentType.compact = false;\n contentType.full = false;\n\n var isnote = $(eleve).find('PageReleveDeNotes Devoir Note').text();\n if(isnote){\n var lastNotes = $(eleve).find('PageReleveDeNotes Devoir')\n\n lastNotes.each(function(i, result){\n var pageUrl = $(result).attr('page');\n var note = $(result).find('Note').text();\n var bareme = $(result).find('Bareme').text();\n var matiere = $(result).find('Matiere').text();\n var notedate:any = L10n.moment($(result).find('Date').text());\n notedate = notedate.format('DD/MM/YYYY');\n var grade = note+\"/\"+bareme+\" \"+lang.translate('carnet-de-bord.widget.in')+\" \"+matiere+\" \"+lang.translate('carnet-de-bord.widget.the')+\" \"+notedate;\n\n allGrades.push({\n value : grade,\n pageUrl : pageUrl\n });\n contentType.compact = allGrades[0].value\n\n })\n contentType.full = allGrades\n }\n\n } else if( contentType.title === 'diary' ) {\n var allWorks:any[] = [];\n contentType.compact = false;\n contentType.full = false;\n\n var iswork = $(eleve).find('PageCahierDeTextes CahierDeTextes TravailAFaire Descriptif').text();\n if (iswork) {\n const parser = new DOMParser();\n var diaries = $(eleve).find('PageCahierDeTextes CahierDeTextes');\n $(diaries).each(function(i, diary){\n if ($(diary).find('TravailAFaire Descriptif').text()) {\n\n let matiere = lang.translate('carnet-de-bord.widget.new.homework')+\" \"+$(diary).find('Matiere').text()\n let works = $(diary).find('TravailAFaire');\n let subsections:any[] = [];\n\n $(works).each(function(i, work){\n let pageUrl = $(work).attr('page');\n let matiereFirst = $(work).parent().find('Matiere').text()\n let delivdate:any = L10n.moment($(work).find('PourLe').text())\n delivdate = delivdate.format('DD/MM/YYYY');\n delivdate = lang.translate('carnet-de-bord.widget.for')+\" \"+delivdate\n let descr:any = $(work).find('Descriptif');\n //can throw a DOMException\n //descr = descr.html(descr.text()).text();\n const doc = parser.parseFromString(descr.text(), 'text/html');\n descr = doc.documentElement.textContent;\n\n subsections.push({\n header: delivdate,\n content: descr,\n pageUrl: pageUrl\n })\n })\n\n allWorks.push({\n value: matiere,\n subsections: subsections\n });\n contentType.compact = allWorks[0].value+\" \"+allWorks[0].subsections[0].header\n }\n })\n\n contentType.full = allWorks\n }\n } else if( contentType.title === 'skills' ) {\n let allSkills:any[] = [];\n let subsections:any[] = [];\n contentType.compact = false;\n contentType.full = false;\n\n var isSkill = $(eleve).find('PageCompetences Competence').text();\n\n if (isSkill) {\n var skills = $(eleve).find('PageCompetences Competence').parent()\n skills.each(function(i, skill){\n if ($(skill).find('Libelle').text()===\"Acquis\") {\n var pageUrl = $(skill).attr('page');\n var title = $(skill).find('Intitule').text();\n var competence = $(skill).find('Competence').text()+\" \";\n var item = $(skill).find('Item').text()+\" \";\n\n var matiere = $(skill).find('Matiere').text();\n var skillDate:any = L10n.moment($(skill).find('Date').text());\n skillDate = skillDate.format('DD/MM/YYYY');\n\n var headskill = lang.translate('carnet-de-bord.widget.skills')+\" \";\n var headitem = lang.translate('carnet-de-bord.widget.skills.item')+\" \";\n\n var fullTitle = title +\" \"+lang.translate('carnet-de-bord.widget.the')+\" \"+skillDate;\n\n if(matiere){\n fullTitle = fullTitle+\" \"+lang.translate('carnet-de-bord.widget.in')+\" \"+matiere;\n }\n\n var subsections = [{\n header: headskill,\n content: competence\n }];\n\n if($(skill).find('Item').text()){\n subsections.push({\n header: headitem,\n content: item\n })\n }\n allSkills.push({\n value: fullTitle,\n subsections: subsections,\n pageUrl: pageUrl\n });\n contentType.compact = allSkills[0].value;\n }\n })\n contentType.full = allSkills;\n }\n }\n\t}\n}\n\n/* Directive */\nclass Directive implements IDirective<IScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./carnet-de-bord.widget.html').default;\n\tcontroller = [\"odeThemeHelperService\", Controller];\n\tcontrollerAs = 'ctrl';\n require = ['odeCarnetDeBord'];\n\n link(scope:IScope, 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\thttp().get('/sso/pronote')\n\t\t.then( (structures:any[]) => {\n if( http().latestResponse.status !== 200 ) {\n /* Mocked data for testing during development.\n structures = [{\n \"structureId\" : null,\n \"xmlResponse\" : \"<?xml version=\\\"1.0\\\"?>\\r\\n<Parent xmlns=\\\"http://www.index-education.com/accueilENT\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.index-education.com/accueilENT Parent.xsd\\\" version=\\\"1.03\\\"><Eleve><Nom>BESNIER</Nom><Prenom>Amelie</Prenom><IdentifiantPronote>74CPUWN8RAJQVM5K</IdentifiantPronote><PageReleveDeNotes><Titre>Relevé de notes<\\/Titre><Message>Publication du bulletin le 20\\/02<\\/Message><Devoir page=\\\"da89cbc9e593f9c4273356659410b0780a616fc5b398d64ba174e138ae0fd5adb4c4b787aa38a237966c8478db61faea\\\"><Note>15,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>TECHNOLOGIE<\\/Matiere><Date>2012-03-26<\\/Date><\\/Devoir><Devoir><Note>17,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>NOTE DE VIE SCOLAIRE<\\/Matiere><Date>2012-03-26<\\/Date><\\/Devoir><Devoir><Note>14,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>ALLEMAND LV2<\\/Matiere><Date>2012-03-25<\\/Date><\\/Devoir><\\/PageReleveDeNotes><PageCahierDeTextes><Titre>Travaux \\u00E0 faire<\\/Titre><CahierDeTextes><Matiere>MATHEMATIQUE<\\/Matiere><Date>2012-03-24<\\/Date><TravailAFaire><Descriptif>Lire et apprendre<\\/Descriptif><PourLe>2012-03-25<\\/PourLe><PieceJointe>2 géométrie, fonctions.doc?sessionENT=20200<\\/PieceJointe><SiteInternet>http:\\/\\/www.google.com<\\/SiteInternet><\\/TravailAFaire><\\/CahierDeTextes><\\/PageCahierDeTextes><PageVieScolaire><Titre>Vie scolaire</Titre><Absence page=\\\"72DF243042E894648C14FB0D5D1EE3081D1E004C8F652CBDA731EEB8BD00ED2DAFCDB4EF61078786E411BFD357C4E35922C97134B3A119EB2F49DCE79E38168F\\\"><DateDebut>2016-09-20T08:00:00</DateDebut><DateFin>2016-09-20T09:00:00</DateFin><EstOuverte>false</EstOuverte><Justifie>false</Justifie><Motif></Motif></Absence></PageVieScolaire></Eleve><Eleve><Nom>BESNIER</Nom><Prenom>Marie</Prenom><IdentifiantPronote>X5VKRNQ9W7MHA4SU</IdentifiantPronote><PageReleveDeNotes><Titre>Relevé de notes<\\/Titre><Message>Publication du bulletin le 20\\/02<\\/Message><Devoir page=\\\"da89cbc9e593f9c4273356659410b0780a616fc5b398d64ba174e138ae0fd5adb4c4b787aa38a237966c8478db61faea\\\"><Note>15,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>TECHNOLOGIE<\\/Matiere><Date>2012-03-26<\\/Date><\\/Devoir><Devoir><Note>17,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>NOTE DE VIE SCOLAIRE<\\/Matiere><Date>2012-03-26<\\/Date><\\/Devoir><Devoir><Note>14,00<\\/Note><Bareme>20.00<\\/Bareme><Matiere>ALLEMAND LV2<\\/Matiere><Date>2012-03-25<\\/Date><\\/Devoir><\\/PageReleveDeNotes><PageCompetences><Titre>Compétences</Titre><Item page=\\\"FC560506B53C466323C3BB6495BA0C3DD788475225004AE89B4B662475B2F533614EF0A1574E1DA7DFA4FCF0A893C7C9DC5ADABABB04084A0504CED0FE06CF25B8C36ADDC1F5451527B117A97425276A\\\"><Competence>Langue française à l'oral et à l'écrit</Competence><Intitule>Résumer un texte</Intitule><NiveauDAcquisition><Genre>2</Genre><Libelle>Acquis</Libelle></NiveauDAcquisition><Date>2016-09-21</Date></Item><Item page=\\\"FC560506B53C466323C3BB6495BA0C3DD788475225004AE89B4B662475B2F533614EF0A1574E1DA7DFA4FCF0A893C7C9DC5ADABABB04084A0504CED0FE06CF25B8C36ADDC1F5451527B117A97425276A\\\"><Competence>Langue française à l'oral et à l'écrit</Competence><Intitule>Adapter le propos au destinataire et à l’effet recherché</Intitule><NiveauDAcquisition><Genre>2</Genre><Libelle>Acquis</Libelle></NiveauDAcquisition><Date>2016-09-21</Date></Item><Item page=\\\"FC560506B53C466323C3BB6495BA0C3DD788475225004AE89B4B662475B2F533614EF0A1574E1DA7DFA4FCF0A893C7C9DC5ADABABB04084A0504CED0FE06CF25B8C36ADDC1F5451527B117A97425276A\\\"><Competence>Langue française à l'oral et à l'écrit</Competence><Intitule>Utiliser les principales règles d’orthographe lexicale et grammaticale</Intitule><NiveauDAcquisition><Genre>2</Genre><Libelle>Acquis</Libelle></NiveauDAcquisition><Date>2016-09-21</Date></Item><Item page=\\\"FC560506B53C466323C3BB6495BA0C3DD788475225004AE89B4B662475B2F533614EF0A1574E1DA7DFA4FCF0A893C7C9DC5ADABABB04084A0504CED0FE06CF25B8C36ADDC1F5451527B117A97425276A\\\"><Competence>Langue française à l'oral et à l'écrit</Competence><Intitule>Rédiger un texte bref, cohérent, construit en paragraphes, correctement ponctué, en respectant des consignes imposées : récit, description, explication, texte argumentatif, compte rendu, écrits courants (lettres, …)</Intitule><NiveauDAcquisition><Genre>2</Genre><Libelle>Acquis</Libelle></NiveauDAcquisition><Date>2016-09-21</Date></Item><Item page=\\\"FC560506B53C466323C3BB6495BA0C3DD788475225004AE89B4B662475B2F533614EF0A1574E1DA7DFA4FCF0A893C7C9DC5ADABABB04084A0504CED0FE06CF25B8C36ADDC1F5451527B117A97425276A\\\"><Competence>Langue française à l'oral et à l'écrit</Competence><Intitule>Répondre à une question par une phrase complète</Intitule><NiveauDAcquisition><Genre>2</Genre><Libelle>Acquis</Libelle></NiveauDAcquisition><Date>2016-09-21</Date></Item></PageCompetences><PageCahierDeTextes><Titre>Cahier de textes</Titre></PageCahierDeTextes><PageVieScolaire><Titre>Vie scolaire</Titre><Absence page=\\\"914686157E0EC40CF0E0E5F762886F121D1E004C8F652CBDA731EEB8BD00ED2D73787C8D4D7E599A35A8B1A97BFE8E51587812524363C51E86538C2E7DB934C6\\\"><DateDebut>2016-09-21T08:00:00</DateDebut><DateFin>2016-09-21T09:00:00</DateFin><EstOuverte>false</EstOuverte><Justifie>false</Justifie><Motif></Motif></Absence><Absence page=\\\"914686157E0EC40CF0E0E5F762886F121D1E004C8F652CBDA731EEB8BD00ED2D73787C8D4D7E599A35A8B1A97BFE8E51587812524363C51E86538C2E7DB934C6\\\"><DateDebut>2016-09-21T08:00:00</DateDebut><DateFin>2016-09-21T09:00:00</DateFin><EstOuverte>false</EstOuverte><Justifie>true</Justifie><Motif></Motif></Absence><Absence page=\\\"914686157E0EC40CF0E0E5F762886F121D1E004C8F652CBDA731EEB8BD00ED2D73787C8D4D7E599A35A8B1A97BFE8E51587812524363C51E86538C2E7DB934C6\\\"><DateDebut>2016-09-22T08:00:00</DateDebut><DateFin></DateFin><EstOuverte>true</EstOuverte><Justifie>false</Justifie><Motif></Motif></Absence><Retard page=\\\"914686157E0EC40CF0E0E5F762886F121D1E004C8F652CBDA731EEB8BD00ED2D73787C8D4D7E599A35A8B1A97BFE8E51587812524363C51E86538C2E7DB934C6\\\"><Date>2016-09-23T08:00:00</Date><Justifie>true</Justifie><Motif></Motif></Retard><Retard page=\\\"914686157E0EC40CF0E0E5F762886F121D1E004C8F652CBDA731EEB8BD00ED2D73787C8D4D7E599A35A8B1A97BFE8E51587812524363C51E86538C2E7DB934C6\\\"><Date>2016-09-24T08:00:00</Date><Justifie>false</Justifie><Motif></Motif></Retard></PageVieScolaire></Eleve><PageMessagerie><Titre>Messagerie</Titre><Discussions page=\\\"81C70AC5418CE75797C2C7B44181715FA2CA23E7B1634350133911009499746D\\\"><NombreMessagesNonLus>0</NombreMessagesNonLus></Discussions><Informations page=\\\"62962842B1203FD963629E4DC8294206CFC0BCED2CDD00E466FC2436F64DBC81\\\"><NombreInformationsNonLus>0</NombreInformationsNonLus></Informations></PageMessagerie></Parent>\\r\\n\",\n \"address\" : \"https://WSEducation.index-education.net/pronote\" \n }];\n */\n throw \"carnet-de-bord.widget.pronote.access.error\";\n }\n if( !angular.isArray(structures) ) {\n throw \"carnet-de-bord.widget.nodata\";\n }\n\t\t\tctrl.structures = structures;\n\t\t\tctrl.eleves = [];\n let firstEleve:boolean = true;\n\t\t\tstructures.forEach( structure => {\n\t\t\t\tctrl.structureAddress = structure.address;\n\t\t\t\tctrl.structureId = structure.structureId;\n\t\t\t\tvar xmlDocument = $.parseXML(structure.xmlResponse);\n\t\t\t\tvar $xml = $(xmlDocument);\n\t\t\t\tctrl.parentTag = $xml.find('Parent');\n\t\t\t\tctrl.eleves = ctrl.eleves.concat($.makeArray($xml.find('Eleve')));\n\t\t\t\t//console.log(widget.eleves);\n\t\t\t\tif( firstEleve && ctrl.eleves.length > 0 ){\n\t\t\t\t\tctrl.getEleve(0);\n firstEleve = false;\n\t\t\t\t}\n\t\t\t});\n scope.$apply();\n\t\t})\n\t\t.catch( (e) => {\n // FIXME : format of error messages ?\n if( typeof e === \"string\" ) {\n ctrl.errorMsg = {error:e};\n } else {\n ctrl.errorMsg = JSON.parse(http().latestResponse.statusText);\n }\n\t\t});\t\t\n\t}\n}\n\n/** The carnet-de-bord widget.\n *\n * Usage:\n * <ode-carnet-de-bord></ode-carnet-de-bord>\n */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then( lang => {\n\tswitch( lang ) {\n\t\tdefault:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n\t}\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeCarnetDeBordModule\";\nangular.module( odeModuleName, []).directive( \"odeCarnetDeBord\", DirectiveFactory );\n"],"names":["themeHelperSvc","me","session","user","description","structures","eleves","showLightbox","contentTypes","title","icon","compact","full","lightboxTitle","structureAddress","structureId","getAvatar","index","this","length","getChildId","toSkinUrl","getEleve","currentEleve","forEach","type","getContent","getTag","tagName","$","find","text","getCurrentTag","userStatus","xmlFirstName","toLowerCase","xmlLastName","id","children","modelFname","firstName","modelLname","lastName","openLightBox","contentType","e","currentContentType","currentTarget","trackEvent","detail","p","bubbles","event","open","properties","CustomEvent","TrackedActionFromWidget","carnetDeBord","dispatchEvent","eleve","lang","conf","Platform","idiom","delays","each","i","delay","pageUrl","parent","attr","L10n","moment","translate","format","push","value","allAbsences","absences","absence","absDate","startdate","enddate","allGrades","result","note","bareme","matiere","notedate","grade","allWorks","DOMParser","diaries","diary","works","work","delivdate","descr","doc","parseFromString","documentElement","textContent","header","content","subsections","skill","competence","item","skillDate","headskill","headitem","fullTitle","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","http","get","then","latestResponse","status","isArray","firstEleve","structure","address","xmlDocument","parseXML","xmlResponse","$xml","parentTag","concat","makeArray","$apply","catch","errorMsg","error","JSON","parse","statusText","notif","onLangReady","promise","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[376],{1918:(t,i,e)=>{e.d(i,{Z:()=>n});const n=' <div class="widget-news"> <div class="widget-header"> <div class="subtitle"> <a class="seemore" href="/actualites" i18n-title="last-infos-widget.widget.see.all" dnd-nodrag ng-click="trackEvent($event, { detail:{\'open\':\'app\'} })"> <i18n>last-infos-widget.widget.title</i18n> <span class="seemore-text"><i18n>last-infos-widget.widget.see.more</i18n></span> </a> </div> <div class="widget-options"> <div class="widget-handle" title="Déplacer le widget"><i class="fas fa-grip-vertical" aria-hidden="true"></i></div> </div> </div> <div class="widget-body" dnd-nodrag> <div class="widget-empty-message" ng-if="ctrl.infos === undefined || ctrl.infos.length === 0"> <i18n>last-infos-widget.widget.empty</i18n> </div> <a class="news-row" ng-repeat="info in ctrl.infos track by info.
|
|
1
|
+
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[376],{1918:(t,i,e)=>{e.d(i,{Z:()=>n});const n=' <div class="widget-news"> <div class="widget-header"> <div class="subtitle"> <a class="seemore" href="/actualites" i18n-title="last-infos-widget.widget.see.all" dnd-nodrag ng-click="trackEvent($event, { detail:{\'open\':\'app\'} })"> <i18n>last-infos-widget.widget.title</i18n> <span class="seemore-text"><i18n>last-infos-widget.widget.see.more</i18n></span> </a> </div> <div class="widget-options"> <div class="widget-handle" title="Déplacer le widget"><i class="fas fa-grip-vertical" aria-hidden="true"></i></div> </div> </div> <div class="widget-body" dnd-nodrag> <div class="widget-empty-message" ng-if="ctrl.infos === undefined || ctrl.infos.length === 0"> <i18n>last-infos-widget.widget.empty</i18n> </div> <a class="news-row" ng-repeat="info in ctrl.infos track by info.id" ng-href="/actualites#/view/thread/[[info.thread.id]]/info/[[info.id]]" ng-click="trackEvent($event, {detail:{\'open\':\'info\'} })"> <div class="news-row-image"> <img ng-if="!info.thread.icon" skin-src="/img/illustrations/news.svg" alt="[[info.thread.title]]" width="40" height="40"/> <img ng-if="info.thread.icon" ng-src="[[info.thread.icon]]?thumbnail=120x120" alt="[[info.thread.title]]" width="40" height="40"/> </div> <div class="news-row-text"> <span class="link d-block">[[info.title]]</span> <span class="meta">[[info.relativeDate]] - [[info.username]]</span> </div> </a> </div> </div> '},5479:function(t,i,e){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i,"__esModule",{value:!0}),i.odeModuleName=void 0;var s=n(e(4202)),o=e(9419),a=e(5262),d=function(){function t(){this.widget=new a.LastInfosWidget,this.lang=(0,o.conf)().Platform.idiom,this.infos=[],this.resultSizeValues=[1,2,3,4,5,6,7,8,9,10],this.resultSize=4,this.display={edition:!1}}return t.prototype.load=function(){var t=this;return this.widget.loadInfos(this.resultSize).then(function(i){t.infos=i.map(function(i){return i.relativeDate=o.L10n.moment(i.modifiedDate).fromNow(),i.tooltip=t.lang.translate("last-infos-widget.widget.thread")+" : "+i.thread.title+" | "+t.lang.translate("last-infos-widget.widget.author")+" : "+i.username,i})})},t.prototype.openConfig=function(){this.display.edition=!0},t.prototype.closeConfig=function(){this.display.edition=!1},t.prototype.saveConfig=function(){return this.widget.setMaxResults(this.resultSize)},t}(),l=function(){function t(){this.restrict="E",this.template=e(1918).Z,this.controller=[d],this.controllerAs="ctrl",this.require=["odeLastInfosWidget"]}return t.prototype.link=function(t,i,e,n){var s=n?n[0]:null;s&&(t.trackEvent=function(t,i){var e,n;void 0===i.bubbles&&(i.bubbles=!0);var s=null;(i&&"app"===(null===(e=i.detail)||void 0===e?void 0:e.open)||i&&"info"===(null===(n=i.detail)||void 0===n?void 0:n.open))&&(s=new CustomEvent(o.TrackedActionFromWidget.lastInfos,i)),s&&t.currentTarget&&t.currentTarget.dispatchEvent(s)},s.widget.getMaxResults().then(function(i){s.resultSize=i,s.load().then(function(){t.$apply()})}))},t}();(0,o.notif)().onLangReady().promise.then(function(t){(0,o.conf)().Platform.idiom.addKeys(e(723))}),i.odeModuleName="odeLastInfosWidgetModule",s.default.module(i.odeModuleName,[]).directive("odeLastInfosWidget",function(){return new l})},723:t=>{t.exports=JSON.parse('{"last-infos-widget.widget.author":"Auteur","last-infos-widget.widget.bad.request.invalid.size":"Nombre d\'actualités invalide : veuillez choisir un nombre compris entre 1 et 20.","last-infos-widget.widget.bad.request.size.must.be.an.integer":"Nombre d\'actualités invalide : veuillez utiliser un nombre.","last-infos-widget.widget.config":"Configurer","last-infos-widget.widget.config.cancel":"Annuler","last-infos-widget.widget.config.nbr":"Nombre d\'actualités à afficher","last-infos-widget.widget.config.save":"Enregistrer","last-infos-widget.widget.config.title":"Configuration","last-infos-widget.widget.empty":"Aucune actualité","last-infos-widget.widget.options":"Options du widget","last-infos-widget.widget.see.all":"Voir toutes les actualités","last-infos-widget.widget.see.more":"voir plus","last-infos-widget.widget.thread":"Fil","last-infos-widget.widget.title":"Actualités"}')}}]);
|
|
2
2
|
//# sourceMappingURL=last-infos-widget.widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets/last-infos-widget/last-infos-widget.widget.js","mappings":"gIAGA,QAFW,
|
|
1
|
+
{"version":3,"file":"widgets/last-infos-widget/last-infos-widget.widget.js","mappings":"gIAGA,QAFW,k2C,mLCDX,iBACA,UACA,UAQA,0BACQ,KAAAA,OAAS,IAAI,EAAAC,gBACZ,KAAAC,MAAO,IAAAC,QAAOC,SAASC,MAExB,KAAAC,MAAkC,GAClC,KAAAC,iBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IACtC,KAAAC,WAAa,EACb,KAAAC,QAAU,CAChBC,SAAS,EAyBX,QAtBC,YAAAC,KAAA,sBACC,OAAOC,KAAKZ,OAAOa,UAAWD,KAAKJ,YAAaM,KAAM,SAAAR,GACrD,EAAKA,MAAQA,EAAMS,IAAK,SAAAC,GAIvB,OAHCA,EAAiCC,aAAe,EAAAC,KAAKC,OAAOH,EAA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OAAO,IAAIC,CACZ,E","sources":["webpack://ode-ngjs-front/./src/ts/widgets/last-infos-widget/last-infos-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/last-infos-widget/last-infos-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \" <div class=\\\"widget-news\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"subtitle\\\"> <a class=\\\"seemore\\\" href=\\\"/actualites\\\" i18n-title=\\\"last-infos-widget.widget.see.all\\\" dnd-nodrag ng-click=\\\"trackEvent($event, { detail:{'open':'app'} })\\\"> <i18n>last-infos-widget.widget.title</i18n> <span class=\\\"seemore-text\\\"><i18n>last-infos-widget.widget.see.more</i18n></span> </a> </div> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\" title=\\\"Déplacer le widget\\\"><i class=\\\"fas fa-grip-vertical\\\" aria-hidden=\\\"true\\\"></i></div> </div> </div> <div class=\\\"widget-body\\\" dnd-nodrag> <div class=\\\"widget-empty-message\\\" ng-if=\\\"ctrl.infos === undefined || ctrl.infos.length === 0\\\"> <i18n>last-infos-widget.widget.empty</i18n> </div> <a class=\\\"news-row\\\" ng-repeat=\\\"info in ctrl.infos track by info.id\\\" ng-href=\\\"/actualites#/view/thread/[[info.thread.id]]/info/[[info.id]]\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'info'} })\\\"> <div class=\\\"news-row-image\\\"> <img ng-if=\\\"!info.thread.icon\\\" skin-src=\\\"/img/illustrations/news.svg\\\" alt=\\\"[[info.thread.title]]\\\" width=\\\"40\\\" height=\\\"40\\\"/> <img ng-if=\\\"info.thread.icon\\\" ng-src=\\\"[[info.thread.icon]]?thumbnail=120x120\\\" alt=\\\"[[info.thread.title]]\\\" width=\\\"40\\\" height=\\\"40\\\"/> </div> <div class=\\\"news-row-text\\\"> <span class=\\\"link d-block\\\">[[info.title]]</span> <span class=\\\"meta\\\">[[info.relativeDate]] - [[info.username]]</span> </div> </a> </div> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective } from \"angular\";\nimport { L10n, conf, notif, TrackedAction, TrackedScope, TrackedActionFromWidget } from \"../../utils\";\nimport { ILastInfosModel, LastInfosWidget } from \"ode-ts-client\";\n\ninterface IExtendedLastInfosModel extends ILastInfosModel {\n\trelativeDate: string;\n\ttooltip: string;\n}\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tpublic widget = new LastInfosWidget();\n\tprivate lang = conf().Platform.idiom;\n\n\tpublic infos:IExtendedLastInfosModel[] = [];\n\tpublic resultSizeValues = [1,2,3,4,5,6,7,8,9,10];\n\tpublic resultSize = 4;\n\tpublic display = {\n\t\tedition: false\n\t};\n\n\tload():Promise<void> {\n\t\treturn this.widget.loadInfos( this.resultSize ).then( infos => {\n\t\t\tthis.infos = infos.map( info => {\n\t\t\t\t(info as IExtendedLastInfosModel).relativeDate = L10n.moment(info.modifiedDate).fromNow();\n\t\t\t\t(info as IExtendedLastInfosModel).tooltip = this.lang.translate('last-infos-widget.widget.thread') + ' : ' + info.thread.title +\n\t\t\t\t\t' | ' + this.lang.translate('last-infos-widget.widget.author') + ' : ' + info.username;\n\t\t\t\treturn info as IExtendedLastInfosModel;\n\t\t\t});\n\t\t});\n\t};\n\t\n\topenConfig(){\n\t\tthis.display.edition = true;\n\t};\n\t\n\tcloseConfig(){\n\t\tthis.display.edition = false;\n\t};\n\t\n\tsaveConfig(){\n\t\treturn this.widget.setMaxResults( this.resultSize );\n\t};\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./last-infos-widget.widget.html').default;\n\tcontroller = [Controller];\n\tcontrollerAs = 'ctrl';\n require = ['odeLastInfosWidget'];\n\n link(scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]): void {\n const ctrl:Controller|null = controllers ? controllers[0] as Controller : null;\n\t\tif( ! ctrl ) return;\n\n\t\t// Give an opportunity to track some events from outside of this widget.\n\t\tscope.trackEvent = (e:Event, p:CustomEventInit<TrackedAction>) => {\n\t\t\t// Allow events to bubble up.\n\t\t\tif(typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n\t\t\tlet event = null;\n\t\t\tif( p && p.detail?.open==='app' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.lastInfos, p );\n\t\t\t} else if( p && p.detail?.open==='info' ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.lastInfos, p );\n\t\t\t}\n\t\t\tif( event && e.currentTarget ) {\n\t\t\t\te.currentTarget.dispatchEvent(event);\n\t\t\t}\n\t\t}\n\n\t\tctrl.widget.getMaxResults().then( num => {\n\t\t\tctrl.resultSize = num;\n\t\t\tctrl.load().then( () => {\n\t\t\t\tscope.$apply();\n\t\t\t});\n\t\t});\n\t}\n}\n\n/** The last-infos widget.\n *\n * Usage:\n * <ode-last-infos></ode-last-infos>\n */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then( lang => {\n\tswitch( lang ) {\n\t\tdefault:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n\t}\n});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeLastInfosWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeLastInfosWidget\", DirectiveFactory );\n"],"names":["widget","LastInfosWidget","lang","conf","Platform","idiom","infos","resultSizeValues","resultSize","display","edition","load","this","loadInfos","then","map","info","relativeDate","L10n","moment","modifiedDate","fromNow","tooltip","translate","thread","title","username","openConfig","closeConfig","saveConfig","setMaxResults","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","trackEvent","e","p","bubbles","event","detail","open","CustomEvent","TrackedActionFromWidget","lastInfos","currentTarget","dispatchEvent","getMaxResults","num","$apply","notif","onLangReady","promise","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[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.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.title.placeholder":"Saisissez le titre du nouveau flux RSS","rss-widget.widget.channel.feed.update":"Actualiser","rss-widget.widget.channel.feed.url":"Adresse du flux","rss-widget.widget.channel.feed.url.placeholder":"Saisissez l\'Url du nouveau flux RSS","rss-widget.widget.channel.refresh":"Rafraîchir","rss-widget.widget.channel.undefined":"Aucun flux configuré","rss-widget.widget.empty.info":"Ajoutez un flux RSS pour voir vos derniers articles","rss-widget.widget.title":"RSS"}')}}]);
|
|
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)),s=i(9419),l=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,s.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,s.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){var t;if(!e||"string"!=typeof e.title||!e.title.trim()||"string"!=typeof e.link||!e.link.trim())return!1;var i=e.link.trim();try{var n=new URL(i);if(!["http:","https:"].includes(n.protocol))return!1;var d=n.pathname.toLowerCase(),s=[".rss",".xml",".rdf",".atom",".feed"].some(function(e){return d.endsWith(e)}),l=!(null!==(t=d.split("/").pop())&&void 0!==t?t:"").includes(".");return s||l}catch(e){return!1}},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,s.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,s.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?s.L10n.unix(e):s.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=[l],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(s.TrackedActionFromWidget.rss,t)),n&&e.currentTarget&&e.currentTarget.dispatchEvent(n)})},e}();(0,s.notif)().onLangReady().promise.then(function(e){(0,s.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.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.title.placeholder":"Saisissez le titre du nouveau flux RSS","rss-widget.widget.channel.feed.update":"Actualiser","rss-widget.widget.channel.feed.url":"Adresse du flux","rss-widget.widget.channel.feed.url.placeholder":"Saisissez l\'Url du nouveau flux RSS","rss-widget.widget.channel.refresh":"Rafraîchir","rss-widget.widget.channel.undefined":"Aucun flux configuré","rss-widget.widget.empty.info":"Ajoutez un flux RSS pour voir vos derniers articles","rss-widget.widget.title":"RSS"}')}}]);
|
|
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,KAAM,SAAAC,GAMN,OALGA,GAAYA,EAASC,OAAS,EAChC,EAAKhB,QAAUe,EAAS,GAExB,EAAKf,Q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AChB,GAEAG,QAAQuC,IAAI,qCAEd,EAEA,YAAAE,eAAA,SAAgBjB,GACZjC,KAAKL,QAAQG,eAAiBmC,EAChCjC,KAAKL,QAAQG,kBAAeR,EAE5BU,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,KAAM,WACtB6D,EAAMK,QACP,GAGAL,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,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
|
+
{"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,EA+KhB,QA5KC,YAAAC,UAAA,sBACC,YAAoBT,IAAjBU,KAAKX,SACA,IAAAY,QAAOC,IAAe,iBAC5BC,KAAM,SAAAC,GAMN,OALGA,GAAYA,EAASC,OAAS,EAChC,EAAKhB,QAAUe,EAAS,GAExB,EAAKf,QAAU,CAACE,MAAM,IAEhB,EAAKe,UAAU,EACvB,GACCC,MAAO,SAAAC,GACPC,QAAQC,KAAK,qCAAsCF,GACnD,EAAKnB,QAAU,CAACE,MAAM,GACvB,GAEOS,KAAKM,UAAU,EAExB,EAEQ,YAAAA,UAAR,SAAmBK,GAAnB,WAEC,OADAX,KAAKT,MAAQ,GACNqB,QAAQC,IAAKb,KAAKX,QAAQE,MAAMuB,IAAK,SAAAC,GAC3C,IAAMC,EAAUD,EAAKE,MACrB,OAAiB,OAAdF,EAAKG,MAA+B,KAAdH,EAAKG,MACtB,IAAAjB,QAAOC,IAAiB,uBAAyBiB,mBAAmBJ,EAAKG,MAAQ,UAAYP,GACnGR,KAAM,SAAAiB,GACa,iBAATA,GAAsBA,EAAOH,QAAOG,EAAOH,MAAQD,GAC1C,MAAhBI,EAAOC,QAAgB,EAAK9B,MAAMc,OAAS,EAAKb,kBAC9BF,IAAjB8B,EAAOE,OAAoChC,MAAbyB,EAAKQ,MAAqBH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AC,KAAKC,KAAKF,GAEV,EAAAC,KAAKE,OAAOH,OAAM5E,EAAW,OAEzBgF,OAAO,MAAMC,OAAO,0BACvC,EACD,EA9LA,GAiMA,0BACI,KAAAC,SAAW,IACd,KAAAC,SAAW,UACX,KAAAC,WAAa,CAACC,GACd,KAAAC,aAAe,OACZ,KAAAC,QAAU,CAAC,eAyBf,QAvBI,YAAA3D,KAAA,SAAK4D,EAAoBC,EAAaC,EAAmBC,GACrD,IAAMC,EAAuBD,EAAcA,EAAY,GAAmB,KAC1EC,IAGNA,EAAKnF,YAAYI,KAAM,WACtB2E,EAAMK,QACP,GAGAL,EAAMM,WAAa,SAAC5E,EAAS6E,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,GAAS/E,EAAEqF,eACdrF,EAAEqF,cAAcC,cAAcP,EAEhC,EACD,EACD,EA9BA,IAsCA,IAAAQ,SAAQC,cAAcC,QAAQ9F,KAAM,SAAA+F,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 ):boolean {\n\t if (!feed || \n\t typeof feed.title !== 'string' || !feed.title.trim() || \n\t typeof feed.link !== 'string' || !feed.link.trim()) {\n\t return false;\n\t }\n\n\t const urlString = feed.link.trim();\n\n\t try {\n\t const urlToCheck = new URL(urlString);\n\n\t // Check protocol\n\t if (!['http:', 'https:'].includes(urlToCheck.protocol)) {\n\t return false;\n\t }\n\n\t const pathname = urlToCheck.pathname.toLowerCase();\n\n\t // Check authorized extensions\n\t const validExtensions = ['.rss', '.xml', '.rdf', '.atom', '.feed']; \n\n\t const hasValidExtension = validExtensions.some(ext => pathname.endsWith(ext));\n\n\t // No extension is valid too\n\t\t\tconst lastSegment = pathname.split('/').pop() ?? '';\n\t\t\tconst hasNoExtension = !lastSegment.includes('.');\n\n\t return hasValidExtension || hasNoExtension;\n\n\t } catch (e) {\n\t return false; // URL not authorized\n\t }\t\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","urlString","urlToCheck","URL","includes","protocol","pathname","toLowerCase","hasValidExtension","some","ext","endsWith","hasNoExtension","split","pop","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":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ode-ngjs-front",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.20-develop-b2school.202601061442",
|
|
4
4
|
"description": "Open Digital Education Frontend Framework",
|
|
5
5
|
"homepage": "https://github.com/opendigitaleducation/ode-ngjs-front#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"karma-chrome-launcher": "3.1.0",
|
|
54
54
|
"karma-jasmine": "4.0.1",
|
|
55
55
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
56
|
-
"ode-ts-client": "
|
|
56
|
+
"ode-ts-client": "develop-b2school",
|
|
57
57
|
"terser-webpack-plugin": "5.1.4",
|
|
58
58
|
"ts-loader": "8.0.18",
|
|
59
59
|
"typescript": "4.6.4",
|