From 75602a2e1a31164c6318d16d1d41d02533a3bd05 Mon Sep 17 00:00:00 2001 From: heitzig Date: Sat, 2 Jul 2022 00:49:48 +0200 Subject: [PATCH] new version --- .../vodle/examples\302\247TEST_urlaub.json" | 37 +++++++++++++++++++ docs/9701.4c52363c13f73908.js.map | 2 +- examples/auto.csv | 7 ++++ examples/firmenstandort.csv | 7 ++++ examples/heizung.csv | 6 +++ examples/wohnen.csv | 11 ++++++ src/app/draftpoll/draftpoll.page.html | 4 +- 7 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 "couchdb/vodle/examples\302\247TEST_urlaub.json" create mode 100644 examples/auto.csv create mode 100644 examples/firmenstandort.csv create mode 100644 examples/heizung.csv create mode 100644 examples/wohnen.csv diff --git "a/couchdb/vodle/examples\302\247TEST_urlaub.json" "b/couchdb/vodle/examples\302\247TEST_urlaub.json" new file mode 100644 index 000000000..78897fdee --- /dev/null +++ "b/couchdb/vodle/examples\302\247TEST_urlaub.json" @@ -0,0 +1,37 @@ +{ + "is_test": true, + + "type": "winner", + + "language": "de", + + "title": "Gemeinsamer Urlaub des Fledermauszüchtervereins Telegrafenberg", + + "desc": "Nach 30 Jahren erfolgreicher Fledermauszucht haben wir uns einen Urlaub verdient! Nur wohin soll's gehen?", + + "due_type": "custom", + + "options": [ + { + "name": "Südsee-Kreuzfahrt", + "desc": "Ganz entspannt verwöhnen lassen und was zu sehen bekommen", + "ratings": [100,100,100,100,100, 100,100,100,100,100, 0,0,0,0,0, 0,0,0,0,0] + }, + { + "name": "Skiwoche in St. Moritz", + "desc": "Jede Menge Action", + "ratings": [0,0,0,0,0, 0,0,0,0,0, 100,100,100,100,100, 100,100,100,100,100] + }, + { + "name": "Höhlenklettern bei Budapest", + "desc": "Dort gibt es auch Fledermäuse", + "ratings": [0,0,19,24,22, 53,60,67,74,71, 34,34,44,46,54, 84,88,94,0,0] + }, + { + "name": "Segeltörn von Kiel nach Stockholm", + "desc": "auf einer klassischen Yacht", + "ratings": [72,73,81,84,93, 22,25,31,36,43, 0,4,8,13,19, 43,51,54,63,62] + } + ] + +} diff --git a/docs/9701.4c52363c13f73908.js.map b/docs/9701.4c52363c13f73908.js.map index 99d46d519..31dbdf0a2 100644 --- a/docs/9701.4c52363c13f73908.js.map +++ b/docs/9701.4c52363c13f73908.js.map @@ -1 +1 @@ -{"version":3,"mappings":"uTA2DQA,gBAGEA,uBAGWA,iBACbA,+BANIA,qCAGAA,6GAoBJA,uEAGIA,wEAJNA,SACEA,wBAKFA,6CAJOA,2KA4BHA,uEAGIA,wEAJNA,SACEA,wBAKFA,6CAJOA,6LArBXA,SACEA,uBAA+C,kBAE3CA,uCAGFA,QACAA,wBAMEA,sDAAaC,kBAAbD,CAA+B,sCACpBE,EADoBC,OACpBD,yBADXF,CAA+B,8CAEpBI,yCACbJ,UAEFA,kBACEA,iCAOFA,QACFA,iCA1BYA,qDAEAA,8CACJA,4DAK2BA,8CAA6B,wDAUvBA,kFA6BrCA,oDAGEA,oEAKAA,uEAGIA,wEAJNA,SACEA,wBAKFA,6CAJOA,8NA3BXA,SACEA,uBAA0C,kBAEtCA,uCAGFA,QAEAA,2BAMEA,sDAAaK,iBAAbL,CAA6B,sCAClBM,EADkBH,OAClBG,wBADXN,CAA6B,8CAElBO,wCACbP,QACAA,+BAKFA,QACAA,kBACEA,iCAOFA,QACFA,iCAhCYA,gDAEAA,8CACJA,2DAM0BA,6CAA4B,wDASvDA,4FAMkCA,iFA4BrCA,oDAGEA,mFAEFA,yBAGIA,0DAASQ,wBAAsBA,gBAAc,YAAWC,SAC1DT,uCAA4CA,iBAC5CA,uBACFA,cAFQA,8EAMNA,uEAGIA,wEAJNA,SACEA,wBAKFA,6CAJOA,uLAjCXA,SACEA,uBAA0C,kBAEtCA,uCAGFA,QACAA,wBAMEA,sDAAaU,gBAAbV,CAA4B,sCACjBW,EADiBR,OACjBQ,uBADXX,CAA4B,8CAEjBY,uCACbZ,QACAA,+BAKAA,+BAOFA,QACAA,kBACEA,kCAOFA,QACFA,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26","ctx_r32","ctx_r34","ctx_r35","ctx_r39","value","ctx_r44","ctx_r46","ctx_r47","ctx_r55","ctx_r57","ctx_r58","ctx_r78","ctx_r80","ctx_r93","ctx_r96","ctx_r98","ctx_r104","i_r67","ctx_r111","ctx_r114","ctx_r116","ctx_r119","ctx_r121","ctx_r122","ctx_r123","ctx_r125","ctx_r126","ctx_r128","ctx_r131","ctx_r132","ev","key","ctrlKey","shiftKey","metaKey","altKey","DraftpollPage","constructor","router","route","formBuilder","popover","alertCtrl","G","translate","ref","this","environment","Math","max","poll_type","type","message","poll_language","poll_title","poll_desc","poll_url","poll_due_type","poll_due_custom","option_name","option_desc","option_url","L","entry","params","subscribe","pid","pd","JSON","parse","decodeURIComponent","n_options","options","length","ngOnInit","reset","ionViewWillEnter","D","page","ionViewDidEnter","ready","onDataReady","deleted","P","polls","state","info","p","language","title","desc","url","due_type","due_custom","db","db_from_pid","db_custom_server_url","db_custom_password","stage","oid","o","Object","entries","push","name","option_stage","warn","Date","expanded","Array","advanced_expanded","formGroup","setValue","S","toISOString","show_details","i","od","add_option_inputs","get","add_option","detectChanges","ionSelects","map","select","type_select","open","MouseEvent","onSelectServerReady","select_server","selectServerFormGroup","ionViewWillLeave","is_test","generate_pid","Poll","set_due","oids","trace","generate_oid","l","Option","ratings","setp","stringify","includes","remove_option","LocalNotifications","notifications","instant","body","id","then","res","catch","err","pids","exit","ionViewDidLeave","save_state","onDataChange","set_poll_type","c","valid","set_poll_language","set_poll_title","set_poll_desc","set_poll_url","set_poll_due_type","set_poll_due_custom","update_ref_date","set_option_name","set_option_desc","set_option_url","set_db","set_db_from_pid","set_db_custom_server_url","set_db_custom_password","set_focus","input_element_id","setTimeout","next_input_element","document","getElementById","setFocus","open_due_select","open_due_custom","changed_poll_type","blur_poll_title","poll_title_onKeydown","is_forward_key","blur_poll_desc","poll_desc_onKeydown","blur_poll_url","poll_url_onKeydown","changed_due_type","changed_poll_due_custom","blur_option_name","option_name_onKeydown","next_option","blur_option_desc","option_desc_onKeydown","blur_option_url","option_url_onKeydown","n","del_poll_dialog","create","buttons","text","role","handler","console","log","del_draft","present","del_option_dialog","del_option","no_more","new_option","showkebap","event","component","DraftpollKebapPage","translucent","showBackdrop","cssClass","componentProps","parent","popoverElement","send4review","import_csv_dialog","header","click","ready_button_clicked","updateValueAndValidity","navigate","group","FormControl","Validators","urlRegex","allowed_date","bind","delete","import_csv","file","target","files","reader","FileReader","onload","content","result","row","split","cols","slice","indexOf","trim","detailstoggle","checked","readAsText","restart_with_data","spec","encodeURIComponent","addControl","j","removeControl","pop","now","control","ref_date","past","get_max_due","too_late","last","valueOf","setDate","getDate","E","max_duration_days","selectors","IonSelect","ElementRef","SelectServerComponent","IonToggle","ctx","routes","path","DraftpollPageRoutingModule","RouterModule","DraftpollPageModule","CommonModule","FormsModule","IonicModule","ReactiveFormsModule","SharedcomponentsModule","TranslateModule"],"sources":["./src/app/draftpoll/draftpoll.page.html","./src/app/draftpoll/draftpoll.page.ts","./src/app/draftpoll/draftpoll-routing.module.ts","./src/app/draftpoll/draftpoll.module.ts"],"sourcesContent":["\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n
\n\n \n \n\n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n  \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n\n \n 0\">\n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n
\n \n \n 1 && show_details\">\n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n
\n\n \n 2 && show_details\">\n \n \n \n \n \n \n \n \n \n \n  \n \n \n \n
\n \n
\n
\n
\n
\n
\n\n \n 3\">\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n
\n
\n\n \n\n 5\" [color]=\"advanced_expanded?'light':''\" (click)=\"advanced_expanded=!advanced_expanded\">\n \n \n \n \n \n \n\n \n 5) && advanced_expanded?'block':'none'\">\n \n  \n \n \n \n \n \n \n\n \n 5) && advanced_expanded?'block':'none'\">\n \n \n \n\n 5\">\n \n \n \n\n \n\n
\n\n \n \n \n \n \n \n \n \n \n \n \n 1 && (formGroup.get('option_name'+i).value||'')==''\" \n [innerHtml]=\"'draftpoll.no-more-button'|translate\"\n color=\"primary\" slot=\"end\" class=\"skip-button\" tabindex=\"0\" \n (click)=\"no_more()\">\n \n 1 && !(i == n_options-1 && i > 1 && (formGroup.get('option_name'+i).value||'')=='')\" \n fill=\"clear\" color=\"primary\" slot=\"end\" class=\"skip-button\" tabindex=\"-1\" \n (click)=\"del_option_dialog(i)\">\n \n \n \n
\n \n
\n
\n
\n
\n\n \n 0 && expanded[i]\">\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n
\n\n \n 1 && expanded[i]\">\n \n \n \n \n \n \n \n \n \n \n  \n \n \n \n
\n \n
\n
\n
\n
\n
\n
\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n \n\n \n \n \n \n \n  \n \n \n \n\n
\n
\n","/*\n(C) Copyright 2015–2022 Potsdam Institute for Climate Impact Research (PIK), authors, and contributors, see AUTHORS file.\n\nThis file is part of vodle.\n\nvodle is free software: you can redistribute it and/or modify it under the \nterms of the GNU Affero General Public License as published by the Free \nSoftware Foundation, either version 3 of the License, or (at your option) \nany later version.\n\nvodle is distributed in the hope that it will be useful, but WITHOUT ANY \nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR \nA PARTICULAR PURPOSE. See the GNU Affero General Public License for more \ndetails.\n\nYou should have received a copy of the GNU Affero General Public License \nalong with vodle. If not, see . \n*/\n\n/*\nTODO:\n- fix next field not showing in android app\n- fix wrong option_stage when returning, make \"skip\" button work properly\n- make tab key autofocus work properly\n*/\n\nimport { Component, OnInit, ViewChild, ViewChildren, ElementRef, QueryList, ChangeDetectorRef } from '@angular/core';\nimport { Validators, FormBuilder, FormGroup, FormControl, ValidationErrors, AbstractControl } from '@angular/forms';\nimport { Router, ActivatedRoute } from \"@angular/router\";\nimport { TranslateService } from '@ngx-translate/core';\n\nimport { PopoverController, IonSelect, IonToggle, AlertController, IonInput, IonDatetime } from '@ionic/angular';\nimport { LocalNotifications } from '@capacitor/local-notifications';\n\nimport { DraftpollKebapPage } from '../draftpoll-kebap/draftpoll-kebap.module'; \n\nimport { GlobalService } from \"../global.service\";\nimport { Poll, Option } from \"../poll.service\";\nimport { SelectServerComponent } from '../sharedcomponents/select-server/select-server.component';\nimport { environment } from 'src/environments/environment';\n\ntype option_data_t = { oid?, name?, desc?, url?, ratings? };\n\nfunction is_forward_key(ev: KeyboardEvent) {\n return (ev.key == \"Tab\" || ev.key == \"Enter\") && !ev.ctrlKey && !ev.shiftKey && !ev.metaKey && !ev.altKey;\n}\n\n@Component({\n selector: 'app-draftpoll',\n templateUrl: './draftpoll.page.html',\n styleUrls: ['./draftpoll.page.scss'],\n})\nexport class DraftpollPage implements OnInit {\n\n E = environment;\n \n // page template elements:\n \n @ViewChild(IonSelect, { static: false, read: ElementRef }) type_select_ref: ElementRef;\n @ViewChild(IonSelect, { static: false }) type_select: IonSelect;\n @ViewChild(IonSelect, { static: false }) due_select: IonSelect;\n @ViewChild(SelectServerComponent, { static: false }) select_server: SelectServerComponent;\n @ViewChild(IonToggle, { static: false }) detailstoggle: IonToggle;\n @ViewChildren(IonSelect) ionSelects: QueryList;\n\n // form:\n\n formGroup: FormGroup;\n stage: number\n option_stage: number;\n expanded: Array;\n advanced_expanded: boolean;\n deleted: boolean;\n\n // draft poll data:\n\n pd: { \n pid?,\n is_test?,\n type?, language?, \n title?, desc?, url?, \n due_type?, due_custom?, \n db?, db_from_pid?, db_custom_server_url?, db_custom_password?,\n options?: option_data_t[] \n };\n get n_options() { return (this.pd.options||[]).length; }\n\n // objects:\n\n pid: string;\n\n // other:\n\n max = Math.max; // function used frequently in template\n\n // LIFECYCLE:\n\n show_details = false;\n ready = false; \n\n constructor(\n private router: Router,\n private route: ActivatedRoute,\n public formBuilder: FormBuilder, \n private popover: PopoverController,\n public alertCtrl: AlertController,\n public G: GlobalService,\n public translate: TranslateService,\n private ref: ChangeDetectorRef\n ) { \n this.G.L.entry(\"DraftpollPage.constructor\");\n this.route.params.subscribe( params => { \n this.pid = params['pid'];\n this.pd = JSON.parse(decodeURIComponent(params['pd']||\"{}\"));\n } );\n }\n \n ngOnInit() {\n this.G.L.entry(\"DraftpollPage.ngOnInit\");\n this.reset();\n }\n\n ionViewWillEnter() {\n this.G.L.entry(\"DraftpollPage.ionViewWillEnter\");\n this.G.D.page = this;\n this.reset();\n }\n\n ionViewDidEnter() {\n this.G.L.entry(\"DraftpollPage.ionViewDidEnter\");\n if (this.G.D.ready && !this.ready) this.onDataReady();\n }\n\n onDataReady() {\n this.G.L.entry(\"DraftpollPage.onDataReady\");\n this.deleted = false;\n if (!this.pid) {\n this.stage = 0;\n if (!this.pd) {\n this.G.L.info(\"DraftpollPage editing new draft\");\n this.pd = { db:'default' };\n } else {\n this.G.L.info(\"DraftpollPage editing draft with data\", this.pd);\n this.pd.due_custom = (this.pd.due_custom||'')!=''?(new Date(this.pd.due_custom)):null;\n this.pd.db = this.pd.db||'default';\n }\n } else if (this.pid in this.G.P.polls) {\n if (this.G.P.polls[this.pid].state == 'draft') {\n this.G.L.info(\"DraftpollPage editing existing draft\", this.pid);\n // read data:\n let p = this.G.P.polls[this.pid];\n this.pd = { \n pid:p.pid,\n type:p.type, language:p.language,\n title:p.title, desc:p.desc, url:p.url, \n due_type:p.due_type, due_custom:p.due_custom, \n db:p.db, db_from_pid:p.db_from_pid, db_custom_server_url:p.db_custom_server_url, db_custom_password:p.db_custom_password,\n options: [] \n };\n this.stage = !(!!p.due_custom)?6:p.due_type?6:p.url!=''?4:p.desc!=''?3:p.title!=''?4:p.type?1:0;\n for (let [oid, o] of Object.entries(p.options)) {\n this.pd.options.push({ oid:oid, name:o.name, desc:o.desc, url:o.url });\n this.stage = 6;\n this.option_stage = 10;\n }\n } else {\n this.G.L.warn(\"DraftpollPage non-draft pid ignored, generating new draft\");\n }\n } else {\n this.G.L.warn(\"DraftpollPage unknown pid ignored, generating new draft\");\n }\n this.expanded = Array(this.n_options);\n this.advanced_expanded = false;\n // fill form:\n if (this.pd) {\n this.formGroup.setValue({ \n poll_type: this.pd.type||'',\n poll_language: (this.pd.language||'')!=''?this.pd.language:this.G.S.language,\n poll_title: this.pd.title||'', \n poll_desc: this.pd.desc||'',\n poll_url: this.pd.url||'', \n poll_due_type: this.pd.due_type||'', \n poll_due_custom: (!this.pd.due_custom)?'':this.pd.due_custom.toISOString(),\n });\n if (this.pd.language||this.pd.db_from_pid||this.pd.db_custom_server_url) {\n this.advanced_expanded = true;\n }\n if (this.pd.desc||this.pd.url) {\n this.show_details = true;\n }\n if (!this.pd.options) {\n this.pd.options = [];\n }\n for (let [i, od] of this.pd.options.entries()) {\n this.add_option_inputs(i);\n this.formGroup.get('option_name'+i).setValue(od.name); \n this.formGroup.get('option_desc'+i).setValue(od.desc); \n this.formGroup.get('option_url'+i).setValue(od.url); \n this.stage = 6;\n this.option_stage = 10;\n if (od.desc||od.url) {\n this.show_details = true;\n }\n }\n }\n if (this.n_options==0) {\n this.add_option({});\n this.option_stage = 0;\n }\n // show the page:\n this.ready = true;\n // find select-server component and register us with it:\n this.ref.detectChanges();\n // make sure select-element values are translated properly:\n this.ionSelects.map((select) => select.value = select.value);\n // open the type selector?:\n if (!this.formGroup.get('poll_type').value) {\n this.type_select.open(new MouseEvent(\"click\"));\n }\n }\n\n onSelectServerReady(select_server:SelectServerComponent) {\n // called by SelectServerComponent is ready\n this.select_server = select_server;\n if (this.pd) {\n this.select_server.selectServerFormGroup.setValue({\n db: this.pd.db||'',\n db_from_pid: this.pd.db_from_pid||'',\n db_custom_server_url: this.pd.db_custom_server_url||'',\n db_custom_password: this.pd.db_custom_password||'',\n });\n }\n }\n\n ionViewWillLeave() {\n this.G.L.entry(\"DraftpollPage.ionViewWillLeave\");\n // TODO: close/dismiss this.type_select, which is a popover\n if ((this.pd.title||'')=='') {\n this.G.L.info(\"DraftpollPage.ionViewWillLeave not saving empty title draft\");\n // TODO: notify of deleted draft\n } else if (!this.deleted) {\n this.G.L.info(\"DraftpollPage.ionViewWillLeave saving draft\");\n var p;\n if (!this.pid) {\n this.pid = (this.pd.is_test == true ? 'TEST_' : '') + this.G.P.generate_pid();\n }\n if (!(this.pid in this.G.P.polls)) {\n // generate new poll object:\n p = new Poll(this.G, this.pid);\n } else {\n p = this.G.P.polls[this.pid];\n }\n p.state = 'draft';\n if (this.pd.is_test == true) {\n p.is_test = true;\n }\n p.type = this.pd.type;\n p.language = this.pd.language;\n p.title = this.pd.title;\n p.desc = this.pd.desc;\n p.url = this.pd.url;\n p.due_type = this.pd.due_type;\n p.due_custom = this.pd.due_custom;\n p.set_due();\n p.db = this.pd.db;\n p.db_from_pid = this.pd.db_from_pid;\n p.db_custom_server_url = this.pd.db_custom_server_url;\n p.db_custom_password = this.pd.db_custom_password;\n let oids = [];\n for (let od of this.pd.options) {\n this.G.L.trace(\" storing option data\", od);\n if ((od.name||'')!='') {\n var o: Option;\n if (!od.oid) {\n od.oid = this.G.P.generate_oid(this.pid);\n this.G.L.trace(\" generated new oid\", od.oid);\n }\n if (!(od.oid in p.options)) {\n // generate new options object:\n this.G.L.trace(\" creating new Option object\");\n o = new Option(this.G, p, od.oid, od.name, od.desc, od.url);\n } else {\n o = p.options[od.oid];\n this.G.L.trace(\" reusing Option object\", o);\n o.name = od.name;\n o.desc = od.desc;\n o.url = od.url;\n }\n oids.push(od.oid);\n if (p.is_test && !!od.ratings) {\n // mark poll as test poll and store ratings of simulated voters:\n this.G.D.setp(this.pid, 'simulated_ratings.'+od.oid, JSON.stringify(od.ratings));\n }\n }\n }\n this.G.L.trace(\" oids now\", oids);\n // remove deleted options from p:\n for (let [oid, o] of Object.entries(p.options)) {\n if (!oids.includes(oid)) {\n this.G.L.trace(\" removing old option\", oid);\n p.remove_option(oid);\n }\n }\n // send local notification:\n LocalNotifications.schedule({\n notifications: [{\n title: this.translate.instant(\"draftpoll.notification-saved-title\"),\n body: p.title,\n id: 1 // TODO: increment or leave out?\n }]\n })\n .then(res => {\n this.G.L.trace(\"DraftpollPage.ionViewWillLeave localNotifications.schedule succeeded:\", res);\n }).catch(err => {\n this.G.L.warn(\"DraftpollPage.ionViewWillLeave localNotifications.schedule failed:\", err);\n });\n }\n this.G.L.trace(\"DraftpollPage.ionViewWillLeave D.pids:\", [...this.G.D.pids]);\n this.G.L.exit(\"DraftpollPage.ionViewWillLeave\");\n }\n\n ionViewDidLeave() {\n this.G.L.entry(\"DraftpollPage.ionViewDidLeave\");\n this.G.D.save_state();\n this.ready = false; // so that when returning, onDataReady will again be triggered\n this.G.L.exit(\"DraftpollPage.ionViewDidLeave\");\n }\n\n // OTHER HOOKS:\n\n // for DataService:\n\n onDataChange() {\n // called whenever data stored in database has changed\n this.G.L.entry(\"DraftpollPage.onDataChange\");\n // TODO: what?\n }\n\n // for form actions:\n\n set_poll_type() {\n let c = this.formGroup.get('poll_type');\n if (c.valid) this.pd.type = c.value;\n }\n\n set_poll_language() {\n let c = this.formGroup.get('poll_language');\n if (c.valid) this.pd.language = c.value;\n }\n\n set_poll_title() {\n let c = this.formGroup.get('poll_title');\n if (c.valid) this.pd.title = c.value;\n }\n\n set_poll_desc() {\n let c = this.formGroup.get('poll_desc');\n if (c.valid) this.pd.desc = c.value;\n }\n\n set_poll_url() {\n let c = this.formGroup.get('poll_url');\n if (c.valid) this.pd.url = c.value;\n }\n\n set_poll_due_type() {\n let c = this.formGroup.get('poll_due_type');\n if (c.valid) this.pd.due_type = c.value;\n }\n\n set_poll_due_custom() {\n this.G.P.update_ref_date();\n let c = this.formGroup.get('poll_due_custom');\n if (c.valid) this.pd.due_custom = new Date(c.value);\n }\n\n set_option_name(i: number) {\n let c = this.formGroup.get('option_name'+i);\n this.G.L.trace(\"set_option_name\",i,c.value);\n if (c.valid) this.pd.options[i].name = c.value;\n this.G.L.trace(\"set_option_name result\",this.pd.options,this.pd.options[i]);\n }\n\n set_option_desc(i: number) {\n let c = this.formGroup.get('option_desc'+i);\n if (c.valid) this.pd.options[i].desc = c.value;\n }\n\n set_option_url(i: number) {\n let c = this.formGroup.get('option_url'+i);\n if (c.valid) this.pd.options[i].url = c.value;\n }\n\n // selectServer component hooks:\n\n set_db(value: string) {\n this.pd.db = value;\n }\n\n set_db_from_pid(value: string) {\n this.pd.db_from_pid = value;\n }\n\n set_db_custom_server_url(value: string) {\n this.pd.db_custom_server_url = value;\n }\n\n set_db_custom_password(value: string) {\n this.pd.db_custom_password = value;\n }\n\n // focus management:\n\n set_focus(input_element_id: string) {\n /** set the focus to a certain IonInput element after 100 ms */\n setTimeout(() => {\n const next_input_element = document.getElementById(input_element_id);\n if (!!next_input_element) {\n next_input_element.setFocus();\n }\n }, 100); \n }\n\n open_due_select() {\n // TODO: find a way to open it so that the title is still visible. \n /**/\n setTimeout(() => {\n (document.getElementById('due_select')).open(new MouseEvent(\"click\"));\n }, 100);\n /**/\n }\n\n open_due_custom() {\n setTimeout(() => {\n (document.getElementById('poll_due_custom')).open();\n }, 100);\n }\n\n changed_poll_type() {\n if (this.stage < 1) {\n this.stage = Math.max(this.stage, 1); \n this.set_focus('input_poll_title'); \n }\n }\n\n blur_poll_title() {\n if (!this.formGroup.get('poll_title').valid) {\n this.set_focus('input_poll_title');\n }\n }\n\n poll_title_onKeydown(ev: KeyboardEvent) {\n if (is_forward_key(ev)) {\n if (this.formGroup.get('poll_title').valid) {\n if (this.stage < 2) {\n this.stage = this.show_details ? 2 : 4;\n }\n if (this.show_details) {\n this.set_focus('input_poll_desc');\n } else {\n this.open_due_select();\n }\n } else {\n this.set_focus('input_poll_title');\n } \n }\n }\n\n blur_poll_desc() {\n }\n\n poll_desc_onKeydown(ev: KeyboardEvent) {\n if (is_forward_key(ev)) {\n if (this.stage < 3) {\n this.stage = 3;\n this.set_focus('input_poll_url'); \n } \n }\n }\n\n blur_poll_url() {\n if (!this.formGroup.get('poll_url').valid) {\n this.set_focus('input_poll_url');\n }\n }\n\n poll_url_onKeydown(ev: KeyboardEvent) {\n if (is_forward_key(ev)) {\n if (this.formGroup.get('poll_url').valid) {\n if (this.stage < 4) {\n this.stage = Math.max(this.stage, 4);\n }\n this.open_due_select(); // TODO: open select for due type \n } else {\n this.set_focus('input_poll_url');\n } \n }\n }\n\n changed_due_type() {\n if (this.stage < 5) {\n if (this.formGroup.get('poll_due_type').value == 'custom') {\n this.stage = 5;\n this.open_due_custom();\n } else {\n this.stage = 6;\n this.set_focus('input_option_name0');\n }\n }\n }\n\n changed_poll_due_custom() {\n if (this.formGroup.get('poll_due_custom').valid) {\n if (this.stage < 6) {\n this.stage = 6;\n this.set_focus('input_option_name0');\n } \n }\n }\n\n blur_option_name(i: number) {\n if (!this.formGroup.get('option_name'+i).valid) {\n this.set_focus('input_option_name'+i);\n }\n }\n\n option_name_onKeydown(ev: KeyboardEvent, i: number, show_details: boolean) {\n if (is_forward_key(ev)) {\n if (this.formGroup.get('option_name'+i).valid) {\n if (show_details) {\n this.option_stage = this.max(this.option_stage, 1);\n this.expanded[i] = true;\n this.set_focus('input_option_desc'+i);\n } else if (i == this.n_options - 1) {\n this.next_option(i);\n }\n } else {\n this.set_focus('input_option_name'+i);\n } \n }\n }\n\n blur_option_desc(i: number) {\n if (!this.formGroup.get('option_desc'+i).valid) {\n this.set_focus('input_option_desc'+i);\n }\n }\n\n option_desc_onKeydown(ev: KeyboardEvent, i: number) {\n if (is_forward_key(ev)) {\n if (this.formGroup.get('option_desc'+i).valid) {\n this.option_stage = Math.max(this.option_stage, 2);\n this.set_focus('input_option_url'+i);\n } else {\n this.set_focus('input_option_desc'+i);\n } \n }\n }\n\n blur_option_url(i: number) {\n if (!this.formGroup.get('option_url'+i).valid) {\n this.set_focus('input_option_url'+i);\n }\n }\n \n option_url_onKeydown(ev: KeyboardEvent, i: number) {\n if (is_forward_key(ev)) {\n if (this.formGroup.get('option_url'+i).valid) {\n if (i == this.n_options - 1) {\n this.next_option(i);\n } else {\n this.set_focus('input_option_name'+(i+1));\n }\n } else {\n this.set_focus('input_option_url'+i);\n } \n }\n }\n\n next_option(i: number) {\n this.option_stage = this.max(this.option_stage, 3);\n this.expanded[i] = false;\n this.add_option({});\n this.set_focus('input_option_name'+(i+1));\n }\n\n async del_poll_dialog() { \n const confirm = await this.alertCtrl.create({ \n message: this.translate.instant(\n \"draftpoll.del-poll-confirm-question\"), \n buttons: [\n { \n text: this.translate.instant('cancel'), \n role: 'Cancel',\n handler: () => { \n console.log('Confirm Cancel.'); \n } \n },\n { \n text: this.translate.instant('OK'),\n role: 'Ok', \n handler: () => {\n this.del_draft();\n } \n } \n ] \n }); \n await confirm.present(); \n } \n\n async del_option_dialog(i: number) { \n const confirm = await this.alertCtrl.create({ \n message: this.translate.instant(\n this.formGroup.get('poll_type').value == 'choice' \n ? \"draftpoll.del-option-confirm-question\" \n : \"draftpoll.del-target-confirm-question\", \n { name: this.formGroup.get('option_name'+i).value }), \n buttons: [\n { \n text: this.translate.instant('cancel'), \n role: 'Cancel',\n handler: () => { \n console.log('Confirm Cancel.'); \n } \n },\n { \n text: this.translate.instant('OK'),\n role: 'Ok', \n handler: () => {\n this.del_option(i);\n } \n } \n ] \n }); \n await confirm.present(); \n } \n\n no_more() {\n if ((this.formGroup.get('option_name'+(this.n_options-1)).value||'')=='') {\n this.option_stage = 10;\n this.del_option(this.n_options-1);\n }\n }\n\n new_option() {\n this.option_stage = 0;\n this.add_option({});\n }\n \n // kebap:\n\n showkebap(event: Event) {\n this.popover.create({\n event, \n component: DraftpollKebapPage, \n translucent: true,\n showBackdrop: false,\n cssClass: 'kebap',\n componentProps: {parent: this}\n })\n .then((popoverElement)=>{\n popoverElement.present();\n })\n }\n\n send4review() { \n this.G.L.warn(\"DraftpollPage.send4review not yet implemented!\");\n }\n\n async import_csv_dialog() { \n const confirm = await this.alertCtrl.create({ \n header: this.translate.instant('draftpoll.import-options-header'), \n message: this.translate.instant(\"draftpoll.import-options-msg\"), \n buttons: [\n { \n text: this.translate.instant('cancel'), \n role: 'Cancel',\n handler: () => { \n console.log('Confirm Cancel.'); \n } \n },\n { \n text: this.translate.instant('choose-file'),\n role: 'Ok', \n handler: () => {\n // open the file chooser by simulating a click to the hidden form field:\n document.getElementById(\"choosefile\").click();\n } \n } \n ] \n }); \n await confirm.present(); \n } \n\n // ready button:\n\n ready_button_clicked() {\n this.formGroup.get('poll_due_custom').updateValueAndValidity();\n if (this.formGroup.valid) {\n if (!this.pid) {\n this.pid = (this.pd.is_test == true ? 'TEST_' : '') + this.G.P.generate_pid();\n }\n this.router.navigate(['/previewpoll/'+this.pid]);\n }\n }\n\n // OTHER METHODS:\n\n private reset() {\n this.formGroup = this.formBuilder.group({\n poll_type: new FormControl('', Validators.required),\n poll_language: new FormControl(''),\n poll_title: new FormControl('', Validators.required),\n poll_desc: new FormControl(''),\n poll_url: new FormControl('', Validators.pattern(this.G.urlRegex)),\n poll_due_type: new FormControl('', Validators.required),\n poll_due_custom: new FormControl('', this.allowed_date.bind(this)),\n });\n this.G.P.update_ref_date();\n }\n\n private del_draft() {\n // TODO!\n if (this.pid) {\n this.G.P.polls[this.pid].delete();\n }\n this.deleted = true;\n this.router.navigate([\"/mypolls\"]);\n }\n\n import_csv(event: Event) {\n const file = (event.target as HTMLInputElement).files[0];\n const reader = new FileReader();\n const page = this;\n reader.onload = function (event) {\n const content = event.target.result as string;\n for (var row of content.split(\"\\n\")) {\n // TODO: improve csv parser!\n var cols = row.split(/\\s*\"\\s*,\\s*\"\\s*/);\n if (cols.length>0) {\n cols[0] = cols[0].slice(cols[0].indexOf('\"')+1);\n cols[cols.length-1] = cols[cols.length-1].slice(0, cols[cols.length-1].indexOf('\"'));\n cols = cols.map(c => c.trim());\n if (cols[0] != \"\") {\n page.no_more();\n if (cols.length==1) { \n page.add_option({ name:cols[0] });\n } else if (cols.length==2) { \n page.add_option({ name:cols[0], desc:cols[1] });\n page.detailstoggle.checked = true;\n } else { \n page.add_option({ name:cols[0], desc:cols[1], url:cols[2]}); \n page.detailstoggle.checked = true;\n }\n page.stage = 10;\n page.option_stage = 10;\n }\n }\n }\n }\n reader.readAsText(file);\n }\n\n restart_with_data(spec: string) {\n this.G.L.info(\"DraftpollPage.restart_with_data\", spec);\n this.router.navigate(['/draftpoll/use/'+encodeURIComponent(spec)]);\n }\n\n private add_option(od: option_data_t) {\n let i = this.n_options;\n this.pd.options.push(od);\n this.add_option_inputs(i);\n this.formGroup.get('option_name'+i).setValue(od.name); \n this.formGroup.get('option_desc'+i).setValue(od.desc); \n this.formGroup.get('option_url'+i).setValue(od.url); \n }\n\n private add_option_inputs(i:number) {\n this.formGroup.addControl('option_name'+i, new FormControl(\"\", Validators.required));\n this.formGroup.addControl('option_desc'+i, new FormControl(\"\"));\n this.formGroup.addControl('option_url'+i, new FormControl(\"\", Validators.pattern(this.G.urlRegex)));\n this.option_stage = 0;\n }\n \n private del_option(i: number) {\n // move metadata of options i+1,i+2,... back one slot to i,i+1,...:\n for (let j=i+1; j= value)\n {\n return {past: true};\n }\n // check whether too far in future:\n if (this.get_max_due() < value)\n {\n return {too_late: true};\n }\n return null;\n }\n }\n\n get_max_due() {\n const last = new Date(this.G.P.ref_date.valueOf());\n last.setDate(last.getDate() + this.E.polls.max_duration_days);\n return last;\n }\n\n // CONSTANTS:\n\n validation_messages = {\n 'poll_type': [\n { type: 'required', message: 'validation.poll-type-required' },\n ],\n 'poll_language': [\n ],\n 'poll_title': [\n { type: 'required', message: 'validation.poll-title-required' },\n ],\n 'poll_desc': [\n ],\n 'poll_url': [\n { type: 'pattern', message: 'validation.poll-url-valid' },\n ],\n 'poll_due_type': [\n { type: 'required', message: 'validation.poll-due-type-required' },\n ],\n 'poll_due_custom': [\n { message: 'validation.poll-due-future' },\n ],\n 'option_name': [\n { type: 'required', message: 'validation.option-name-required' },\n ],\n 'option_desc': [\n ],\n 'option_url': [\n { type: 'pattern', message: 'validation.option-url-valid' },\n ],\n }\n \n}\n","/*\n(C) Copyright 2015–2022 Potsdam Institute for Climate Impact Research (PIK), authors, and contributors, see AUTHORS file.\n\nThis file is part of vodle.\n\nvodle is free software: you can redistribute it and/or modify it under the \nterms of the GNU Affero General Public License as published by the Free \nSoftware Foundation, either version 3 of the License, or (at your option) \nany later version.\n\nvodle is distributed in the hope that it will be useful, but WITHOUT ANY \nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR \nA PARTICULAR PURPOSE. See the GNU Affero General Public License for more \ndetails.\n\nYou should have received a copy of the GNU Affero General Public License \nalong with vodle. If not, see . \n*/\n\nimport { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\n\nimport { DraftpollPage } from './draftpoll.page';\n\nconst routes: Routes = [\n {\n path: '',\n component: DraftpollPage\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class DraftpollPageRoutingModule {}\n","/*\n(C) Copyright 2015–2022 Potsdam Institute for Climate Impact Research (PIK), authors, and contributors, see AUTHORS file.\n\nThis file is part of vodle.\n\nvodle is free software: you can redistribute it and/or modify it under the \nterms of the GNU Affero General Public License as published by the Free \nSoftware Foundation, either version 3 of the License, or (at your option) \nany later version.\n\nvodle is distributed in the hope that it will be useful, but WITHOUT ANY \nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR \nA PARTICULAR PURPOSE. See the GNU Affero General Public License for more \ndetails.\n\nYou should have received a copy of the GNU Affero General Public License \nalong with vodle. If not, see . \n*/\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { TranslateModule } from '@ngx-translate/core';\n\nimport { IonicModule } from '@ionic/angular';\n\nimport { DraftpollPageRoutingModule } from './draftpoll-routing.module';\nimport { SharedcomponentsModule } from '../sharedcomponents/sharedcomponents.module';\n\nimport { DraftpollPage } from './draftpoll.page';\nexport { DraftpollPage } from './draftpoll.page';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n IonicModule,\n ReactiveFormsModule,\n DraftpollPageRoutingModule,\n SharedcomponentsModule,\n TranslateModule.forChild()\n ],\n declarations: [DraftpollPage]\n})\nexport class DraftpollPageModule {}\n"],"sourceRoot":"webpack:///","file":"9701.4c52363c13f73908.js"} \ No newline at end of file +{"version":3,"mappings":"uTA2DQA,gBAGEA,uBAGWA,iBACbA,+BANIA,qCAGAA,6GAoBJA,uEAGIA,wEAJNA,SACEA,wBAKFA,6CAJOA,2KA4BHA,uEAGIA,wEAJNA,SACEA,wBAKFA,6CAJOA,6LArBXA,SACEA,uBAA+C,kBAE3CA,uCAGFA,QACAA,wBAMEA,sDAAaC,kBAAbD,CAA+B,sCACpBE,EADoBC,OACpBD,yBADXF,CAA+B,8CAEpBI,yCACbJ,UAEFA,kBACEA,iCAOFA,QACFA,iCA1BYA,qDAEAA,8CACJA,4DAK2BA,8CAA6B,wDAUvBA,kFA6BrCA,oDAGEA,oEAKAA,uEAGIA,wEAJNA,SACEA,wBAKFA,6CAJOA,8NA3BXA,SACEA,uBAA0C,kBAEtCA,uCAGFA,QAEAA,2BAMEA,sDAAaK,iBAAbL,CAA6B,sCAClBM,EADkBH,OAClBG,wBADXN,CAA6B,8CAElBO,wCACbP,QACAA,+BAKFA,QACAA,kBACEA,iCAOFA,QACFA,iCAhCYA,gDAEAA,8CACJA,2DAM0BA,6CAA4B,wDASvDA,4FAMkCA,iFA4BrCA,oDAGEA,mFAEFA,yBAGIA,0DAASQ,wBAAsBA,gBAAc,YAAWC,SAC1DT,uCAA4CA,iBAC5CA,uBACFA,cAFQA,8EAMNA,uEAGIA,wEAJNA,SACEA,wBAKFA,6CAJOA,uLAjCXA,SACEA,uBAA0C,kBAEtCA,uCAGFA,QACAA,wBAMEA,sDAAaU,gBAAbV,CAA4B,sCACjBW,EADiBR,OACjBQ,uBADXX,CAA4B,8CAEjBY,uCACbZ,QACAA,+BAKAA,+BAOFA,QACAA,kBACEA,kCAOFA,QACFA,iCAtCYA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32","ctx_r34","ctx_r35","ctx_r39","value","ctx_r44","ctx_r46","ctx_r47","ctx_r55","ctx_r57","ctx_r58","ctx_r78","ctx_r80","ctx_r93","ctx_r96","ctx_r98","ctx_r104","i_r67","ctx_r111","ctx_r114","ctx_r116","ctx_r119","ctx_r121","ctx_r122","ctx_r123","ctx_r125","ctx_r126","ctx_r128","ctx_r131","ctx_r132","ev","key","ctrlKey","shiftKey","metaKey","altKey","DraftpollPage","constructor","router","route","formBuilder","popover","alertCtrl","G","translate","ref","this","environment","Math","max","poll_type","type","message","poll_language","poll_title","poll_desc","poll_url","poll_due_type","poll_due_custom","option_name","option_desc","option_url","L","entry","params","subscribe","pid","pd","JSON","parse","decodeURIComponent","n_options","options","length","ngOnInit","reset","ionViewWillEnter","D","page","ionViewDidEnter","ready","onDataReady","deleted","P","polls","state","info","p","language","title","desc","url","due_type","due_custom","db","db_from_pid","db_custom_server_url","db_custom_password","stage","oid","o","Object","entries","push","name","option_stage","warn","Date","expanded","Array","advanced_expanded","formGroup","setValue","S","toISOString","show_details","i","od","add_option_inputs","get","add_option","detectChanges","ionSelects","map","select","type_select","open","MouseEvent","onSelectServerReady","select_server","selectServerFormGroup","ionViewWillLeave","is_test","generate_pid","Poll","set_due","oids","trace","generate_oid","l","Option","ratings","setp","stringify","includes","remove_option","LocalNotifications","notifications","instant","body","id","then","res","catch","err","pids","exit","ionViewDidLeave","save_state","onDataChange","set_poll_type","c","valid","set_poll_language","set_poll_title","set_poll_desc","set_poll_url","set_poll_due_type","set_poll_due_custom","update_ref_date","set_option_name","set_option_desc","set_option_url","set_db","set_db_from_pid","set_db_custom_server_url","set_db_custom_password","set_focus","input_element_id","setTimeout","next_input_element","document","getElementById","setFocus","open_due_select","open_due_custom","changed_poll_type","blur_poll_title","poll_title_onKeydown","is_forward_key","blur_poll_desc","poll_desc_onKeydown","blur_poll_url","poll_url_onKeydown","changed_due_type","changed_poll_due_custom","blur_option_name","option_name_onKeydown","next_option","blur_option_desc","option_desc_onKeydown","blur_option_url","option_url_onKeydown","n","del_poll_dialog","create","buttons","text","role","handler","console","log","del_draft","present","del_option_dialog","del_option","no_more","new_option","showkebap","event","component","DraftpollKebapPage","translucent","showBackdrop","cssClass","componentProps","parent","popoverElement","send4review","import_csv_dialog","header","click","ready_button_clicked","updateValueAndValidity","navigate","group","FormControl","Validators","urlRegex","allowed_date","bind","delete","import_csv","file","target","files","reader","FileReader","onload","content","result","row","split","cols","slice","indexOf","trim","detailstoggle","checked","readAsText","restart_with_data","spec","encodeURIComponent","addControl","j","removeControl","pop","now","control","ref_date","past","get_max_due","too_late","last","valueOf","setDate","getDate","E","max_duration_days","selectors","IonSelect","ElementRef","SelectServerComponent","IonToggle","ctx","routes","path","DraftpollPageRoutingModule","RouterModule","DraftpollPageModule","CommonModule","FormsModule","IonicModule","ReactiveFormsModule","SharedcomponentsModule","TranslateModule"],"sources":["./src/app/draftpoll/draftpoll.page.html","./src/app/draftpoll/draftpoll.page.ts","./src/app/draftpoll/draftpoll-routing.module.ts","./src/app/draftpoll/draftpoll.module.ts"],"sourcesContent":["\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n
\n\n \n \n\n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n  \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n\n \n 0\">\n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n
\n \n \n 1 && show_details\">\n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n
\n\n \n 2 && show_details\">\n \n \n \n \n \n \n \n \n \n \n  \n \n \n \n
\n \n
\n
\n
\n
\n
\n\n \n 3\">\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n
\n
\n\n \n\n 5\" [color]=\"advanced_expanded?'light':''\" (click)=\"advanced_expanded=!advanced_expanded\">\n \n \n \n \n \n \n\n \n 5) && advanced_expanded?'block':'none'\">\n \n  \n \n \n \n \n \n \n\n \n 5) && advanced_expanded?'block':'none'\">\n \n \n \n\n 5\">\n \n \n \n\n \n\n
\n\n \n \n \n \n \n \n \n \n \n \n \n 1 && (formGroup.get('option_name'+i).value||'')==''\" \n [innerHtml]=\"'draftpoll.no-more-button'|translate\"\n color=\"primary\" slot=\"end\" class=\"skip-button\" tabindex=\"0\" \n (click)=\"no_more()\">\n \n 1 && !(i == n_options-1 && i > 1 && (formGroup.get('option_name'+i).value||'')=='')\" \n fill=\"clear\" color=\"primary\" slot=\"end\" class=\"skip-button\" tabindex=\"-1\" \n (click)=\"del_option_dialog(i)\">\n \n \n \n
\n \n
\n
\n
\n
\n\n \n 0 && expanded[i]\">\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n
\n\n \n 1 && expanded[i]\">\n \n \n \n \n \n \n \n \n \n \n  \n \n \n \n
\n \n
\n
\n
\n
\n
\n
\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n \n\n \n \n \n \n \n  \n \n \n \n\n
\n
\n","/*\n(C) Copyright 2015–2022 Potsdam Institute for Climate Impact Research (PIK), authors, and contributors, see AUTHORS file.\n\nThis file is part of vodle.\n\nvodle is free software: you can redistribute it and/or modify it under the \nterms of the GNU Affero General Public License as published by the Free \nSoftware Foundation, either version 3 of the License, or (at your option) \nany later version.\n\nvodle is distributed in the hope that it will be useful, but WITHOUT ANY \nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR \nA PARTICULAR PURPOSE. See the GNU Affero General Public License for more \ndetails.\n\nYou should have received a copy of the GNU Affero General Public License \nalong with vodle. If not, see . \n*/\n\n/*\nTODO:\n- fix next field not showing in android app\n- fix wrong option_stage when returning, make \"skip\" button work properly\n- make tab key autofocus work properly\n*/\n\nimport { Component, OnInit, ViewChild, ViewChildren, ElementRef, QueryList, ChangeDetectorRef } from '@angular/core';\nimport { Validators, FormBuilder, FormGroup, FormControl, ValidationErrors, AbstractControl } from '@angular/forms';\nimport { Router, ActivatedRoute } from \"@angular/router\";\nimport { TranslateService } from '@ngx-translate/core';\n\nimport { PopoverController, IonSelect, IonToggle, AlertController, IonInput, IonDatetime } from '@ionic/angular';\nimport { LocalNotifications } from '@capacitor/local-notifications';\n\nimport { DraftpollKebapPage } from '../draftpoll-kebap/draftpoll-kebap.module'; \n\nimport { GlobalService } from \"../global.service\";\nimport { Poll, Option } from \"../poll.service\";\nimport { SelectServerComponent } from '../sharedcomponents/select-server/select-server.component';\nimport { environment } from 'src/environments/environment';\n\ntype option_data_t = { oid?, name?, desc?, url?, ratings? };\n\nfunction is_forward_key(ev: KeyboardEvent) {\n return (ev.key == \"Tab\" || ev.key == \"Enter\") && !ev.ctrlKey && !ev.shiftKey && !ev.metaKey && !ev.altKey;\n}\n\n@Component({\n selector: 'app-draftpoll',\n templateUrl: './draftpoll.page.html',\n styleUrls: ['./draftpoll.page.scss'],\n})\nexport class DraftpollPage implements OnInit {\n\n E = environment;\n \n // page template elements:\n \n @ViewChild(IonSelect, { static: false, read: ElementRef }) type_select_ref: ElementRef;\n @ViewChild(IonSelect, { static: false }) type_select: IonSelect;\n @ViewChild(IonSelect, { static: false }) due_select: IonSelect;\n @ViewChild(SelectServerComponent, { static: false }) select_server: SelectServerComponent;\n @ViewChild(IonToggle, { static: false }) detailstoggle: IonToggle;\n @ViewChildren(IonSelect) ionSelects: QueryList;\n\n // form:\n\n formGroup: FormGroup;\n stage: number\n option_stage: number;\n expanded: Array;\n advanced_expanded: boolean;\n deleted: boolean;\n\n // draft poll data:\n\n pd: { \n pid?,\n is_test?,\n type?, language?, \n title?, desc?, url?, \n due_type?, due_custom?, \n db?, db_from_pid?, db_custom_server_url?, db_custom_password?,\n options?: option_data_t[] \n };\n get n_options() { return (this.pd.options||[]).length; }\n\n // objects:\n\n pid: string;\n\n // other:\n\n max = Math.max; // function used frequently in template\n\n // LIFECYCLE:\n\n show_details = false;\n ready = false; \n\n constructor(\n private router: Router,\n private route: ActivatedRoute,\n public formBuilder: FormBuilder, \n private popover: PopoverController,\n public alertCtrl: AlertController,\n public G: GlobalService,\n public translate: TranslateService,\n private ref: ChangeDetectorRef\n ) { \n this.G.L.entry(\"DraftpollPage.constructor\");\n this.route.params.subscribe( params => { \n this.pid = params['pid'];\n this.pd = JSON.parse(decodeURIComponent(params['pd']||\"{}\"));\n } );\n }\n \n ngOnInit() {\n this.G.L.entry(\"DraftpollPage.ngOnInit\");\n this.reset();\n }\n\n ionViewWillEnter() {\n this.G.L.entry(\"DraftpollPage.ionViewWillEnter\");\n this.G.D.page = this;\n this.reset();\n }\n\n ionViewDidEnter() {\n this.G.L.entry(\"DraftpollPage.ionViewDidEnter\");\n if (this.G.D.ready && !this.ready) this.onDataReady();\n }\n\n onDataReady() {\n this.G.L.entry(\"DraftpollPage.onDataReady\");\n this.deleted = false;\n if (!this.pid) {\n this.stage = 0;\n if (!this.pd) {\n this.G.L.info(\"DraftpollPage editing new draft\");\n this.pd = { db:'default' };\n } else {\n this.G.L.info(\"DraftpollPage editing draft with data\", this.pd);\n this.pd.due_custom = (this.pd.due_custom||'')!=''?(new Date(this.pd.due_custom)):null;\n this.pd.db = this.pd.db||'default';\n }\n } else if (this.pid in this.G.P.polls) {\n if (this.G.P.polls[this.pid].state == 'draft') {\n this.G.L.info(\"DraftpollPage editing existing draft\", this.pid);\n // read data:\n let p = this.G.P.polls[this.pid];\n this.pd = { \n pid:p.pid,\n type:p.type, language:p.language,\n title:p.title, desc:p.desc, url:p.url, \n due_type:p.due_type, due_custom:p.due_custom, \n db:p.db, db_from_pid:p.db_from_pid, db_custom_server_url:p.db_custom_server_url, db_custom_password:p.db_custom_password,\n options: [] \n };\n this.stage = !(!!p.due_custom)?6:p.due_type?6:p.url!=''?4:p.desc!=''?3:p.title!=''?4:p.type?1:0;\n for (let [oid, o] of Object.entries(p.options)) {\n this.pd.options.push({ oid:oid, name:o.name, desc:o.desc, url:o.url });\n this.stage = 6;\n this.option_stage = 10;\n }\n } else {\n this.G.L.warn(\"DraftpollPage non-draft pid ignored, generating new draft\");\n }\n } else {\n this.G.L.warn(\"DraftpollPage unknown pid ignored, generating new draft\");\n }\n this.expanded = Array(this.n_options);\n this.advanced_expanded = false;\n // fill form:\n if (this.pd) {\n this.formGroup.setValue({ \n poll_type: this.pd.type||'',\n poll_language: (this.pd.language||'')!=''?this.pd.language:this.G.S.language,\n poll_title: this.pd.title||'', \n poll_desc: this.pd.desc||'',\n poll_url: this.pd.url||'', \n poll_due_type: this.pd.due_type||'', \n poll_due_custom: (!this.pd.due_custom)?'':this.pd.due_custom.toISOString(),\n });\n if (this.pd.language||this.pd.db_from_pid||this.pd.db_custom_server_url) {\n this.advanced_expanded = true;\n }\n if (this.pd.desc||this.pd.url) {\n this.show_details = true;\n }\n if (!this.pd.options) {\n this.pd.options = [];\n }\n for (let [i, od] of this.pd.options.entries()) {\n this.add_option_inputs(i);\n this.formGroup.get('option_name'+i).setValue(od.name); \n this.formGroup.get('option_desc'+i).setValue(od.desc); \n this.formGroup.get('option_url'+i).setValue(od.url); \n this.stage = 6;\n this.option_stage = 10;\n if (od.desc||od.url) {\n this.show_details = true;\n }\n }\n }\n if (this.n_options==0) {\n this.add_option({});\n this.option_stage = 0;\n }\n // show the page:\n this.ready = true;\n // find select-server component and register us with it:\n this.ref.detectChanges();\n // make sure select-element values are translated properly:\n this.ionSelects.map((select) => select.value = select.value);\n // open the type selector?:\n if (!this.formGroup.get('poll_type').value) {\n this.type_select.open(new MouseEvent(\"click\"));\n }\n }\n\n onSelectServerReady(select_server:SelectServerComponent) {\n // called by SelectServerComponent is ready\n this.select_server = select_server;\n if (this.pd) {\n this.select_server.selectServerFormGroup.setValue({\n db: this.pd.db||'',\n db_from_pid: this.pd.db_from_pid||'',\n db_custom_server_url: this.pd.db_custom_server_url||'',\n db_custom_password: this.pd.db_custom_password||'',\n });\n }\n }\n\n ionViewWillLeave() {\n this.G.L.entry(\"DraftpollPage.ionViewWillLeave\");\n // TODO: close/dismiss this.type_select, which is a popover\n if ((this.pd.title||'')=='') {\n this.G.L.info(\"DraftpollPage.ionViewWillLeave not saving empty title draft\");\n // TODO: notify of deleted draft\n } else if (!this.deleted) {\n this.G.L.info(\"DraftpollPage.ionViewWillLeave saving draft\");\n var p;\n if (!this.pid) {\n this.pid = (this.pd.is_test == true ? 'TEST_' : '') + this.G.P.generate_pid();\n }\n if (!(this.pid in this.G.P.polls)) {\n // generate new poll object:\n p = new Poll(this.G, this.pid);\n } else {\n p = this.G.P.polls[this.pid];\n }\n p.state = 'draft';\n if (this.pd.is_test == true) {\n p.is_test = true;\n }\n p.type = this.pd.type;\n p.language = this.pd.language;\n p.title = this.pd.title;\n p.desc = this.pd.desc;\n p.url = this.pd.url;\n p.due_type = this.pd.due_type;\n p.due_custom = this.pd.due_custom;\n p.set_due();\n p.db = this.pd.db;\n p.db_from_pid = this.pd.db_from_pid;\n p.db_custom_server_url = this.pd.db_custom_server_url;\n p.db_custom_password = this.pd.db_custom_password;\n let oids = [];\n for (let od of this.pd.options) {\n this.G.L.trace(\" storing option data\", od);\n if ((od.name||'')!='') {\n var o: Option;\n if (!od.oid) {\n od.oid = this.G.P.generate_oid(this.pid);\n this.G.L.trace(\" generated new oid\", od.oid);\n }\n if (!(od.oid in p.options)) {\n // generate new options object:\n this.G.L.trace(\" creating new Option object\");\n o = new Option(this.G, p, od.oid, od.name, od.desc, od.url);\n } else {\n o = p.options[od.oid];\n this.G.L.trace(\" reusing Option object\", o);\n o.name = od.name;\n o.desc = od.desc;\n o.url = od.url;\n }\n oids.push(od.oid);\n if (p.is_test && !!od.ratings) {\n // mark poll as test poll and store ratings of simulated voters:\n this.G.D.setp(this.pid, 'simulated_ratings.'+od.oid, JSON.stringify(od.ratings));\n }\n }\n }\n this.G.L.trace(\" oids now\", oids);\n // remove deleted options from p:\n for (let [oid, o] of Object.entries(p.options)) {\n if (!oids.includes(oid)) {\n this.G.L.trace(\" removing old option\", oid);\n p.remove_option(oid);\n }\n }\n // send local notification:\n LocalNotifications.schedule({\n notifications: [{\n title: this.translate.instant(\"draftpoll.notification-saved-title\"),\n body: p.title,\n id: 1 // TODO: increment or leave out?\n }]\n })\n .then(res => {\n this.G.L.trace(\"DraftpollPage.ionViewWillLeave localNotifications.schedule succeeded:\", res);\n }).catch(err => {\n this.G.L.warn(\"DraftpollPage.ionViewWillLeave localNotifications.schedule failed:\", err);\n });\n }\n this.G.L.trace(\"DraftpollPage.ionViewWillLeave D.pids:\", [...this.G.D.pids]);\n this.G.L.exit(\"DraftpollPage.ionViewWillLeave\");\n }\n\n ionViewDidLeave() {\n this.G.L.entry(\"DraftpollPage.ionViewDidLeave\");\n this.G.D.save_state();\n this.ready = false; // so that when returning, onDataReady will again be triggered\n this.G.L.exit(\"DraftpollPage.ionViewDidLeave\");\n }\n\n // OTHER HOOKS:\n\n // for DataService:\n\n onDataChange() {\n // called whenever data stored in database has changed\n this.G.L.entry(\"DraftpollPage.onDataChange\");\n // TODO: what?\n }\n\n // for form actions:\n\n set_poll_type() {\n let c = this.formGroup.get('poll_type');\n if (c.valid) this.pd.type = c.value;\n }\n\n set_poll_language() {\n let c = this.formGroup.get('poll_language');\n if (c.valid) this.pd.language = c.value;\n }\n\n set_poll_title() {\n let c = this.formGroup.get('poll_title');\n if (c.valid) this.pd.title = c.value;\n }\n\n set_poll_desc() {\n let c = this.formGroup.get('poll_desc');\n if (c.valid) this.pd.desc = c.value;\n }\n\n set_poll_url() {\n let c = this.formGroup.get('poll_url');\n if (c.valid) this.pd.url = c.value;\n }\n\n set_poll_due_type() {\n let c = this.formGroup.get('poll_due_type');\n if (c.valid) this.pd.due_type = c.value;\n }\n\n set_poll_due_custom() {\n this.G.P.update_ref_date();\n let c = this.formGroup.get('poll_due_custom');\n if (c.valid) this.pd.due_custom = new Date(c.value);\n }\n\n set_option_name(i: number) {\n let c = this.formGroup.get('option_name'+i);\n this.G.L.trace(\"set_option_name\",i,c.value);\n if (c.valid) this.pd.options[i].name = c.value;\n this.G.L.trace(\"set_option_name result\",this.pd.options,this.pd.options[i]);\n }\n\n set_option_desc(i: number) {\n let c = this.formGroup.get('option_desc'+i);\n if (c.valid) this.pd.options[i].desc = c.value;\n }\n\n set_option_url(i: number) {\n let c = this.formGroup.get('option_url'+i);\n if (c.valid) this.pd.options[i].url = c.value;\n }\n\n // selectServer component hooks:\n\n set_db(value: string) {\n this.pd.db = value;\n }\n\n set_db_from_pid(value: string) {\n this.pd.db_from_pid = value;\n }\n\n set_db_custom_server_url(value: string) {\n this.pd.db_custom_server_url = value;\n }\n\n set_db_custom_password(value: string) {\n this.pd.db_custom_password = value;\n }\n\n // focus management:\n\n set_focus(input_element_id: string) {\n /** set the focus to a certain IonInput element after 100 ms */\n setTimeout(() => {\n const next_input_element = document.getElementById(input_element_id);\n if (!!next_input_element) {\n next_input_element.setFocus();\n }\n }, 100); \n }\n\n open_due_select() {\n // TODO: find a way to open it so that the title is still visible. \n /**/\n setTimeout(() => {\n (document.getElementById('due_select')).open(new MouseEvent(\"click\"));\n }, 100);\n /**/\n }\n\n open_due_custom() {\n setTimeout(() => {\n (document.getElementById('poll_due_custom')).open();\n }, 100);\n }\n\n changed_poll_type() {\n if (this.stage < 1) {\n this.stage = Math.max(this.stage, 1); \n this.set_focus('input_poll_title'); \n }\n }\n\n blur_poll_title() {\n if (!this.formGroup.get('poll_title').valid) {\n this.set_focus('input_poll_title');\n }\n }\n\n poll_title_onKeydown(ev: KeyboardEvent) {\n if (is_forward_key(ev)) {\n if (this.formGroup.get('poll_title').valid) {\n if (this.stage < 2) {\n this.stage = this.show_details ? 2 : 4;\n }\n if (this.show_details) {\n this.set_focus('input_poll_desc');\n } else {\n this.open_due_select();\n }\n } else {\n this.set_focus('input_poll_title');\n } \n }\n }\n\n blur_poll_desc() {\n }\n\n poll_desc_onKeydown(ev: KeyboardEvent) {\n if (is_forward_key(ev)) {\n if (this.stage < 3) {\n this.stage = 3;\n this.set_focus('input_poll_url'); \n } \n }\n }\n\n blur_poll_url() {\n if (!this.formGroup.get('poll_url').valid) {\n this.set_focus('input_poll_url');\n }\n }\n\n poll_url_onKeydown(ev: KeyboardEvent) {\n if (is_forward_key(ev)) {\n if (this.formGroup.get('poll_url').valid) {\n if (this.stage < 4) {\n this.stage = Math.max(this.stage, 4);\n }\n this.open_due_select(); // TODO: open select for due type \n } else {\n this.set_focus('input_poll_url');\n } \n }\n }\n\n changed_due_type() {\n if (this.stage < 5) {\n if (this.formGroup.get('poll_due_type').value == 'custom') {\n this.stage = 5;\n this.open_due_custom();\n } else {\n this.stage = 6;\n this.set_focus('input_option_name0');\n }\n }\n }\n\n changed_poll_due_custom() {\n if (this.formGroup.get('poll_due_custom').valid) {\n if (this.stage < 6) {\n this.stage = 6;\n this.set_focus('input_option_name0');\n } \n }\n }\n\n blur_option_name(i: number) {\n if (!this.formGroup.get('option_name'+i).valid) {\n this.set_focus('input_option_name'+i);\n }\n }\n\n option_name_onKeydown(ev: KeyboardEvent, i: number, show_details: boolean) {\n if (is_forward_key(ev)) {\n if (this.formGroup.get('option_name'+i).valid) {\n if (show_details) {\n this.option_stage = this.max(this.option_stage, 1);\n this.expanded[i] = true;\n this.set_focus('input_option_desc'+i);\n } else if (i == this.n_options - 1) {\n this.next_option(i);\n }\n } else {\n this.set_focus('input_option_name'+i);\n } \n }\n }\n\n blur_option_desc(i: number) {\n if (!this.formGroup.get('option_desc'+i).valid) {\n this.set_focus('input_option_desc'+i);\n }\n }\n\n option_desc_onKeydown(ev: KeyboardEvent, i: number) {\n if (is_forward_key(ev)) {\n if (this.formGroup.get('option_desc'+i).valid) {\n this.option_stage = Math.max(this.option_stage, 2);\n this.set_focus('input_option_url'+i);\n } else {\n this.set_focus('input_option_desc'+i);\n } \n }\n }\n\n blur_option_url(i: number) {\n if (!this.formGroup.get('option_url'+i).valid) {\n this.set_focus('input_option_url'+i);\n }\n }\n \n option_url_onKeydown(ev: KeyboardEvent, i: number) {\n if (is_forward_key(ev)) {\n if (this.formGroup.get('option_url'+i).valid) {\n if (i == this.n_options - 1) {\n this.next_option(i);\n } else {\n this.set_focus('input_option_name'+(i+1));\n }\n } else {\n this.set_focus('input_option_url'+i);\n } \n }\n }\n\n next_option(i: number) {\n this.option_stage = this.max(this.option_stage, 3);\n this.expanded[i] = false;\n this.add_option({});\n this.set_focus('input_option_name'+(i+1));\n }\n\n async del_poll_dialog() { \n const confirm = await this.alertCtrl.create({ \n message: this.translate.instant(\n \"draftpoll.del-poll-confirm-question\"), \n buttons: [\n { \n text: this.translate.instant('cancel'), \n role: 'Cancel',\n handler: () => { \n console.log('Confirm Cancel.'); \n } \n },\n { \n text: this.translate.instant('OK'),\n role: 'Ok', \n handler: () => {\n this.del_draft();\n } \n } \n ] \n }); \n await confirm.present(); \n } \n\n async del_option_dialog(i: number) { \n const confirm = await this.alertCtrl.create({ \n message: this.translate.instant(\n this.formGroup.get('poll_type').value == 'choice' \n ? \"draftpoll.del-option-confirm-question\" \n : \"draftpoll.del-target-confirm-question\", \n { name: this.formGroup.get('option_name'+i).value }), \n buttons: [\n { \n text: this.translate.instant('cancel'), \n role: 'Cancel',\n handler: () => { \n console.log('Confirm Cancel.'); \n } \n },\n { \n text: this.translate.instant('OK'),\n role: 'Ok', \n handler: () => {\n this.del_option(i);\n } \n } \n ] \n }); \n await confirm.present(); \n } \n\n no_more() {\n if ((this.formGroup.get('option_name'+(this.n_options-1)).value||'')=='') {\n this.option_stage = 10;\n this.del_option(this.n_options-1);\n }\n }\n\n new_option() {\n this.option_stage = 0;\n this.add_option({});\n }\n \n // kebap:\n\n showkebap(event: Event) {\n this.popover.create({\n event, \n component: DraftpollKebapPage, \n translucent: true,\n showBackdrop: false,\n cssClass: 'kebap',\n componentProps: {parent: this}\n })\n .then((popoverElement)=>{\n popoverElement.present();\n })\n }\n\n send4review() { \n this.G.L.warn(\"DraftpollPage.send4review not yet implemented!\");\n }\n\n async import_csv_dialog() { \n const confirm = await this.alertCtrl.create({ \n header: this.translate.instant('draftpoll.import-options-header'), \n message: this.translate.instant(\"draftpoll.import-options-msg\"), \n buttons: [\n { \n text: this.translate.instant('cancel'), \n role: 'Cancel',\n handler: () => { \n console.log('Confirm Cancel.'); \n } \n },\n { \n text: this.translate.instant('choose-file'),\n role: 'Ok', \n handler: () => {\n // open the file chooser by simulating a click to the hidden form field:\n document.getElementById(\"choosefile\").click();\n } \n } \n ] \n }); \n await confirm.present(); \n } \n\n // ready button:\n\n ready_button_clicked() {\n this.formGroup.get('poll_due_custom').updateValueAndValidity();\n if (this.formGroup.valid) {\n if (!this.pid) {\n this.pid = (this.pd.is_test == true ? 'TEST_' : '') + this.G.P.generate_pid();\n }\n this.router.navigate(['/previewpoll/'+this.pid]);\n }\n }\n\n // OTHER METHODS:\n\n private reset() {\n this.formGroup = this.formBuilder.group({\n poll_type: new FormControl('', Validators.required),\n poll_language: new FormControl(''),\n poll_title: new FormControl('', Validators.required),\n poll_desc: new FormControl(''),\n poll_url: new FormControl('', Validators.pattern(this.G.urlRegex)),\n poll_due_type: new FormControl('', Validators.required),\n poll_due_custom: new FormControl('', this.allowed_date.bind(this)),\n });\n this.G.P.update_ref_date();\n }\n\n private del_draft() {\n // TODO!\n if (this.pid) {\n this.G.P.polls[this.pid].delete();\n }\n this.deleted = true;\n this.router.navigate([\"/mypolls\"]);\n }\n\n import_csv(event: Event) {\n const file = (event.target as HTMLInputElement).files[0];\n const reader = new FileReader();\n const page = this;\n reader.onload = function (event) {\n const content = event.target.result as string;\n for (var row of content.split(\"\\n\")) {\n // TODO: improve csv parser!\n var cols = row.split(/\\s*\"\\s*,\\s*\"\\s*/);\n if (cols.length>0) {\n cols[0] = cols[0].slice(cols[0].indexOf('\"')+1);\n cols[cols.length-1] = cols[cols.length-1].slice(0, cols[cols.length-1].indexOf('\"'));\n cols = cols.map(c => c.trim());\n if (cols[0] != \"\") {\n page.no_more();\n if (cols.length==1) { \n page.add_option({ name:cols[0] });\n } else if (cols.length==2) { \n page.add_option({ name:cols[0], desc:cols[1] });\n page.detailstoggle.checked = true;\n } else { \n page.add_option({ name:cols[0], desc:cols[1], url:cols[2]}); \n page.detailstoggle.checked = true;\n }\n page.stage = 10;\n page.option_stage = 10;\n }\n }\n }\n }\n reader.readAsText(file);\n }\n\n restart_with_data(spec: string) {\n this.G.L.info(\"DraftpollPage.restart_with_data\", spec);\n this.router.navigate(['/draftpoll/use/'+encodeURIComponent(spec)]);\n }\n\n private add_option(od: option_data_t) {\n let i = this.n_options;\n this.pd.options.push(od);\n this.add_option_inputs(i);\n this.formGroup.get('option_name'+i).setValue(od.name); \n this.formGroup.get('option_desc'+i).setValue(od.desc); \n this.formGroup.get('option_url'+i).setValue(od.url); \n }\n\n private add_option_inputs(i:number) {\n this.formGroup.addControl('option_name'+i, new FormControl(\"\", Validators.required));\n this.formGroup.addControl('option_desc'+i, new FormControl(\"\"));\n this.formGroup.addControl('option_url'+i, new FormControl(\"\", Validators.pattern(this.G.urlRegex)));\n this.option_stage = 0;\n }\n \n private del_option(i: number) {\n // move metadata of options i+1,i+2,... back one slot to i,i+1,...:\n for (let j=i+1; j= value)\n {\n return {past: true};\n }\n // check whether too far in future:\n if (this.get_max_due() < value)\n {\n return {too_late: true};\n }\n return null;\n }\n }\n\n get_max_due() {\n const last = new Date(this.G.P.ref_date.valueOf());\n last.setDate(last.getDate() + this.E.polls.max_duration_days);\n return last;\n }\n\n // CONSTANTS:\n\n validation_messages = {\n 'poll_type': [\n { type: 'required', message: 'validation.poll-type-required' },\n ],\n 'poll_language': [\n ],\n 'poll_title': [\n { type: 'required', message: 'validation.poll-title-required' },\n ],\n 'poll_desc': [\n ],\n 'poll_url': [\n { type: 'pattern', message: 'validation.poll-url-valid' },\n ],\n 'poll_due_type': [\n { type: 'required', message: 'validation.poll-due-type-required' },\n ],\n 'poll_due_custom': [\n { message: 'validation.poll-due-future' },\n ],\n 'option_name': [\n { type: 'required', message: 'validation.option-name-required' },\n ],\n 'option_desc': [\n ],\n 'option_url': [\n { type: 'pattern', message: 'validation.option-url-valid' },\n ],\n }\n \n}\n","/*\n(C) Copyright 2015–2022 Potsdam Institute for Climate Impact Research (PIK), authors, and contributors, see AUTHORS file.\n\nThis file is part of vodle.\n\nvodle is free software: you can redistribute it and/or modify it under the \nterms of the GNU Affero General Public License as published by the Free \nSoftware Foundation, either version 3 of the License, or (at your option) \nany later version.\n\nvodle is distributed in the hope that it will be useful, but WITHOUT ANY \nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR \nA PARTICULAR PURPOSE. See the GNU Affero General Public License for more \ndetails.\n\nYou should have received a copy of the GNU Affero General Public License \nalong with vodle. If not, see . \n*/\n\nimport { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\n\nimport { DraftpollPage } from './draftpoll.page';\n\nconst routes: Routes = [\n {\n path: '',\n component: DraftpollPage\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class DraftpollPageRoutingModule {}\n","/*\n(C) Copyright 2015–2022 Potsdam Institute for Climate Impact Research (PIK), authors, and contributors, see AUTHORS file.\n\nThis file is part of vodle.\n\nvodle is free software: you can redistribute it and/or modify it under the \nterms of the GNU Affero General Public License as published by the Free \nSoftware Foundation, either version 3 of the License, or (at your option) \nany later version.\n\nvodle is distributed in the hope that it will be useful, but WITHOUT ANY \nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR \nA PARTICULAR PURPOSE. See the GNU Affero General Public License for more \ndetails.\n\nYou should have received a copy of the GNU Affero General Public License \nalong with vodle. If not, see . \n*/\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { TranslateModule } from '@ngx-translate/core';\n\nimport { IonicModule } from '@ionic/angular';\n\nimport { DraftpollPageRoutingModule } from './draftpoll-routing.module';\nimport { SharedcomponentsModule } from '../sharedcomponents/sharedcomponents.module';\n\nimport { DraftpollPage } from './draftpoll.page';\nexport { DraftpollPage } from './draftpoll.page';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n IonicModule,\n ReactiveFormsModule,\n DraftpollPageRoutingModule,\n SharedcomponentsModule,\n TranslateModule.forChild()\n ],\n declarations: [DraftpollPage]\n})\nexport class DraftpollPageModule {}\n"],"sourceRoot":"webpack:///","file":"9701.4c52363c13f73908.js"} \ No newline at end of file diff --git a/examples/auto.csv b/examples/auto.csv new file mode 100644 index 000000000..b74de0222 --- /dev/null +++ b/examples/auto.csv @@ -0,0 +1,7 @@ +"Kleinwagen Benziner" +"SUV" +"Hybrid" +"E-Auto" +"Lastenfahrrad" +"kein eigenes, aber Car-Sharing" +"gar kein Auto" \ No newline at end of file diff --git a/examples/firmenstandort.csv b/examples/firmenstandort.csv new file mode 100644 index 000000000..aa34392c3 --- /dev/null +++ b/examples/firmenstandort.csv @@ -0,0 +1,7 @@ +"Zentral, repräsentativ, Einzelbüros" +"Zentral, repräsentativ, Großraumbüro" +"Zentral, repräsentativ, Desk Sharing und Home Office" +"Gewerbegebiet, Einzelbüros" +"Gewerbegebiet, Großraumbüro" +"Gewerbegebiet, Desk Sharing und Home Office" +"Komplett Home Office und Videokonferenzen" \ No newline at end of file diff --git a/examples/heizung.csv b/examples/heizung.csv new file mode 100644 index 000000000..3a61607dd --- /dev/null +++ b/examples/heizung.csv @@ -0,0 +1,6 @@ +"Gasbrennwerttherme" +"Holzpelletheizung" +"Luftwärmepumpe" +"Erdwärmepumpe" +"Elektroradiatoren" +"Brennstoffzelle" \ No newline at end of file diff --git a/examples/wohnen.csv b/examples/wohnen.csv new file mode 100644 index 000000000..16ee88f71 --- /dev/null +++ b/examples/wohnen.csv @@ -0,0 +1,11 @@ +"Fertige Altbauwohnung" +"Fertige Neubauwohnung" +"Fertiges Einfamilienhaus Massivbau" +"Fertiges Einfamilienhaus Holzständerbauweise mit klassischer Polystyrol-Dämmung" +"Fertiges Einfamilienhaus Holzständerbauweise mit natürlichen Dämmstoffen" +"Neubau Eigenheim Massivbau" +"Neubau Eigenheim Holzständerbauweise mit klassischer Polystyrol-Dämmung" +"Neubau Eigenheim Holzständerbauweise mit natürlichen Dämmstoffen" +"Wohnprojekt Altbau Sanierung / Umbau" +"Wohnprojekt Neubau" +"Alternatives Wohnprojekt / Kommune / Groß-Wohngemeinschaft" \ No newline at end of file diff --git a/src/app/draftpoll/draftpoll.page.html b/src/app/draftpoll/draftpoll.page.html index 4e1b6c46c..18dc0644a 100644 --- a/src/app/draftpoll/draftpoll.page.html +++ b/src/app/draftpoll/draftpoll.page.html @@ -211,7 +211,9 @@ [cancelText]="'cancel'|translate" [okText]="'OK'|translate" #ionSelects tabindex="0" required (ionChange)="set_poll_due_type();changed_due_type()"> - + + +