├── .dockerignore
├── .github
└── workflows
│ ├── docker_container_registry.yml
│ └── gh_container_registry.yml
├── Dockerfile
├── LICENSE
├── data
├── Obsthausen_Fragen.csv
├── Obsthausen_Parteien.csv
├── appel2.jpg
├── banane2.jpg
├── definition.js
├── egal2.jpg
└── tbc2.jpg
├── docker-compose-dev.yml
├── docker-compose.yml
├── extras
├── addon_check_iframe_resize_client.js
├── addon_check_iframe_resize_host.js
├── addon_contacts_in_results.js
├── addon_favorite_party.js
├── addon_limit_results.js
├── addon_permalink_to_personal_result.js
├── addon_results_textfilter_by_button.js
├── addon_show_first_results.js
├── addon_tooltips.js
├── data_fruitville.zip
├── data_obsthausen.zip
├── data_springfield.zip
├── readme.md
├── startSimplePythonServer.txt
├── statistics
│ ├── db_settings.php
│ ├── example_results.ods
│ ├── readme.md
│ ├── results.txt
│ ├── results_db.sql
│ ├── vote_db.php
│ └── vote_txt.php
└── statistics_db
│ ├── htaccess
│ ├── htpasswd
│ ├── read_db_write_text.php
│ ├── readme.md
│ └── results_db.txt
├── i18n
├── i18n_de.js
└── i18n_en.js
├── index.html
├── quicktest.html
├── readme.md
├── results.html
├── styles
├── buttons-colors-off.css
├── buttons-colors-on.css
├── default.css
└── progressbar.css
└── system
├── License-GPL-3.0-en.txt
├── License-MIT-jquery.txt
├── Lizenz-GPL-3.0-de.txt
├── Mat-O-Wahl-Hilfe.odt
├── Mat-O-Wahl-Hilfe.pdf
├── bootstrap4
├── css
│ ├── bootstrap-grid.css
│ ├── bootstrap-grid.css.map
│ ├── bootstrap-grid.min.css
│ ├── bootstrap-grid.min.css.map
│ ├── bootstrap-reboot.css
│ ├── bootstrap-reboot.css.map
│ ├── bootstrap-reboot.min.css
│ ├── bootstrap-reboot.min.css.map
│ ├── bootstrap.css
│ ├── bootstrap.css.map
│ ├── bootstrap.min.css
│ └── bootstrap.min.css.map
├── js
│ ├── bootstrap.bundle.js
│ ├── bootstrap.bundle.js.map
│ ├── bootstrap.bundle.min.js
│ ├── bootstrap.bundle.min.js.map
│ ├── bootstrap.js
│ ├── bootstrap.js.map
│ ├── bootstrap.min.js
│ └── bootstrap.min.js.map
└── version.txt
├── changelog.md
├── general.js
├── imprint.html
├── imprint.js
├── jquery.csv-0.8.9.min.js
├── jquery3
└── jquery-3.4.1.min.js
├── output.js
├── quicktest.js
└── results.js
/.dockerignore:
--------------------------------------------------------------------------------
1 | LICENSE
2 | readme.md
--------------------------------------------------------------------------------
/.github/workflows/docker_container_registry.yml:
--------------------------------------------------------------------------------
1 | name: Build and Push Docker Image to docker registry
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: Set up QEMU
14 | uses: docker/setup-qemu-action@v3
15 |
16 | - name: Set up Docker Buildx
17 | uses: docker/setup-buildx-action@v1
18 |
19 | - name: Log in to Docker Hub
20 | uses: docker/login-action@v1
21 | with:
22 | username: ${{ secrets.docker_username }}
23 | password: ${{ secrets.docker_password }}
24 |
25 | - name: Get latest release tag
26 | id: get_latest_release
27 | uses: pozetroninc/github-action-get-latest-release@master
28 | with:
29 | owner: msteudtn
30 | repo: mat-o-wahl
31 |
32 | - name: Build and push Docker image
33 | uses: docker/build-push-action@v2
34 | with:
35 | file: dockerfile
36 | push: true
37 | platforms: linux/amd64,linux/arm64
38 | tags: ${{ secrets.docker_username }}/mat-o-wahl:latest,${{ secrets.docker_username }}/mat-o-wahl:${{ steps.get_latest_release.outputs.release }}
--------------------------------------------------------------------------------
/.github/workflows/gh_container_registry.yml:
--------------------------------------------------------------------------------
1 | name: Build and Push Docker Image to github registry
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: Get latest release tag
14 | id: get_latest_release
15 | uses: pozetroninc/github-action-get-latest-release@master
16 | with:
17 | owner: msteudtn
18 | repo: mat-o-wahl
19 |
20 | - name: 'Checkout GitHub Action'
21 | uses: actions/checkout@v2
22 |
23 | - name: Set up Docker Buildx
24 | uses: docker/setup-buildx-action@v1
25 |
26 | - name: log in to Github Container Registry
27 | uses: docker/login-action@v2
28 | with:
29 | registry: ghcr.io
30 | username: ${{ github.repository_owner }}
31 | password: ${{ secrets.GHCR_TOKEN }}
32 |
33 | - name: 'Build and push Docker image'
34 | run: |
35 | docker buildx create --use
36 | docker buildx build --platform linux/amd64,linux/arm64 . --tag ghcr.io/msteudtn/mat-o-wahl:latest --tag ghcr.io/mat-o-wahl:${{ steps.get_latest_release.outputs.release }} --push
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM nginx:1.27.3 AS mat-o-wahl
2 | COPY . /usr/share/nginx/html/
3 |
4 | EXPOSE 80
5 |
--------------------------------------------------------------------------------
/data/Obsthausen_Fragen.csv:
--------------------------------------------------------------------------------
1 | "Farbe";"Die beste Fruchtfarbe ist gelb."
2 | "Form";"Die beste Fruchtform ist rund."
3 | "Schale";"Früchte muss man mit ihrer Schale essen können."
4 | "Spinat";"Spinat ist nicht nur gesund, sondern schmeckt auch lecker."
5 | "Reife";"Früchte müssen bis zur vollen Reife an der Pflanze bleiben."
6 | "Süße";"Süße Früchte schmecken am besten."
7 |
--------------------------------------------------------------------------------
/data/Obsthausen_Parteien.csv:
--------------------------------------------------------------------------------
1 | Partei_kurz:;"APPD"
2 | Partei_lang:;"Appelpartei Deutschlands"
3 | Partei_Beschreibung:;"Die Apfelpartei steht seit vielen Jahren für alle Angelegenheiten des Apfels. 👤 "
4 | Partei_URL:;"https://www.appelpartei.ap"
5 | Partei_Bild:;"data/appel2.jpg"
6 | -1;"Gelb ist keine schöne Farbe. Rot ist viel besser!"
7 | 1;"Runde Früchte sind am besten!"
8 | 1;"Volle Zustimmung!"
9 | 0;"Ist uns ziemlich egal."
10 | 1;"Ja, Früchte sollen am Baum bleiben, bis sie reif sind."
11 | 1;"Ja, süße Früchte sind toll."
12 | #
13 | Partei_kurz:;"Bananen"
14 | Partei_lang:;"Bananenrepublikpartei"
15 | Partei_Beschreibung:;"Warum ist die Banane krumm? Weil niemand in den Urwald zog und die Banane grade bog! - Die Bananenpartei kümmert sich um alle Belange der Bananen. "
16 | Partei_URL:;"https://www.banane.ba"
17 | Partei_Bild:;"data/banane2.jpg"
18 | 1;"Gelb ist die beste Farbe! Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
19 | -1;"Früchte müssen lang sein, nicht rund. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
20 | -1;"Wer will denn ernsthaft die Schalte mitessen? Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
21 | -1;"Spinat ist eklig. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
22 | -1;"Früchte können schon früher abgenommen werden und im Container reifen. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
23 | 1;"Süße Früchte sind lecker. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
24 | #;
25 | Partei_kurz:;"TBC"
26 | Partei_lang:;"Tradionelle Bundesdeutsche Citronenpartei"
27 | Partei_Beschreibung:;"Deutsche, kauft deutsche Zitronen! - Gelb, saftig, sauer - ideal um zum Lachen in den Keller zu gehen. "
28 | Partei_URL:;"https://www.die-citronen.ca"
29 | Partei_Bild:;"data/tbc2.jpg"
30 | 1;Gelb ist eindeutig die beste Farbe.
31 | 1;Runde Früchte haben die beste Form!
32 | -1;Die Schale muss nicht mitgegessen werden.
33 | -1;Spinat ist kein gesundes Essen.
34 | -1;Früchte können gern schon frühzeitig abgenommen werden.
35 | -1;Süße Früchte sind für kleine Mädchen. Echte Männer mögen Zitronen!
36 | #
37 | Partei_kurz:;"Neutrale"
38 | Partei_lang:;"Neutrale Partei"
39 | Partei_Beschreibung:;"👤 "
40 | Partei_URL:;"http://www.neutrale-partei.np"
41 | Partei_Bild:;"data/egal2.jpg"
42 | 0;Ist uns egal.
43 | 0;Ist uns egal.
44 | 0;Ist uns egal.
45 | 0;Ist uns egal.
46 | 0;Ist uns egal.
47 | 0;Ist uns egal.
48 |
49 |
--------------------------------------------------------------------------------
/data/appel2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msteudtn/Mat-O-Wahl/a0322f949e5a13082813e5410dae520931e31a4d/data/appel2.jpg
--------------------------------------------------------------------------------
/data/banane2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msteudtn/Mat-O-Wahl/a0322f949e5a13082813e5410dae520931e31a4d/data/banane2.jpg
--------------------------------------------------------------------------------
/data/definition.js:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////
2 |
3 | /*
4 | DEFINITIONEN *** DEFINITIONS
5 | http://www.mat-o-wahl.de
6 |
7 | DE: Bei Problemen benutzen Sie bitte die /QUICKTEST.HTML
8 | oder lesen in der /SYSTEM/MAT-O-WAHL-HILFE.PDF nach.
9 | Diese Datei am besten in einem Editor mit Syntaxhervorhebung bearbeiten. z.B. Notepad++, gedit, kate, ...
10 |
11 | ********************************************************************
12 |
13 | EN: Please try QUICKTEST.HTML in case of problems.
14 | Edit this file with an editor that uses syntax-highlighting, e.g. Notepad++, gedit, kate, ...
15 | */
16 |
17 | ///////////////////////////////////////////////////////////////////////
18 |
19 | /*
20 | 1. ALLGEMEINE / EINFACHE EINSTELLUNGEN:
21 |
22 | DE: Bei den CSV-Dateien bitte beachten:
23 | - ueberall das gleiche Trennzeichen benutzen (z.B. immer nur Komma)
24 | - Zweispaltig aufbauen, z.B.
25 | -- richtig: 1,"Wir sind dafür"
26 | -- richtig: 1,""
27 | -- grenzwertig: 1,
28 | -- falsch: 1
29 |
30 | Bei Problemen mit Umlauten und Sonderzeichen benutzen Sie bitte
31 | den entsprechenden HTML-Code. z.B. ä = ae = ä Anführungszeichen = "
32 | Siehe: http://de.selfhtml.org/html/allgemein/zeichen.htm#umlaute
33 |
34 | ********************************************************************
35 |
36 | 1. GENERAL / SIMPLE SETTINGS
37 |
38 | EN: When creating the CSV files, please take care of:
39 | - use always the same separator (e.g. always comma)
40 | - use two rows, e.g.
41 | -- right: 1,"We support it"
42 | -- right: 1,""
43 | -- borderline: 1,
44 | -- wrong: 1
45 |
46 | In case of problems with special characters, please use its HTML code
47 | see here: https://www.utexas.edu/learn/html/spchar.html
48 |
49 | */
50 |
51 | // --------------------------------------------------------------------
52 |
53 | /*
54 | 1.1. FRAGENKATALOG:
55 | DE: Die erste Spalte der CSV-Datei enthält eine Kurzzusammenfassung der Frage, die zweite Spalte enthält die eigentliche Frage.
56 | z.B. "Flughafenausbau","Der Flughafen soll ausgebaut werden."
57 |
58 | ********************************************************************
59 |
60 | 1.1. LIST OF QUESTIONS:
61 | EN: First row always contains a short summary of the question while the second row holds the question itself.
62 | e.g. "Airport","The airport shall be expanded."
63 | */
64 |
65 | const fileQuestions = "Obsthausen_Fragen.csv";
66 |
67 |
68 | // --------------------------------------------------------------------
69 |
70 | // 1.2 ANZAHL der FRAGEN / 1.2 NUMBER of QUESTIONS
71 |
72 | const intQuestions = 6;
73 |
74 |
75 | // --------------------------------------------------------------------
76 |
77 | /*
78 | 1.3. PARTEIEN, PARTEI-INFORMATIONEN und ANTWORTEN
79 |
80 | Die Datei hat folgenden Aufbau:
81 | 0;Parteiname kurz (z.B. APPD)
82 | 0;Parteiname lang (z.B. Appelpartei Deutschlands)
83 | 0;Beschreibung (optional, z.B. Die Apfelpartei steht seit vielen Jahren für alle Angelegenheiten des Apfels.)
84 | 0;Webseite (z.B. https://www.appelpartei.ap)
85 | 0;Logo / Bilddatei (z.B. appel.png)
86 | Danach kommen die Antworten der Parteien, z.B.
87 | -1;Wir sind dagegen weil ...
88 | 0;Das ist uns egal
89 | 1;Wir sind dafür weil ...
90 | 0;Zum Schluss kommt noch ein Leerzeile ohne Funktion, nur für die Übersicht. Danach geht es mit der nächsten Partei weiter.
91 |
92 | ********************************************************************
93 |
94 | 1.3. PARTIES, PARTY-INFORMATION and ANSWERS
95 | */
96 |
97 | const fileAnswers = "Obsthausen_Parteien.csv";
98 |
99 | /*
100 | 1.5. BILDGROESSE des PARTEILOGOS (am Ende)
101 | DE: Die Breite und Höhe kann in Pixel und Prozent angegeben werden.
102 |
103 | ********************************************************************
104 |
105 | 1.5. PICTURE SIZE OF PARTY-LOGO (at the end)
106 | EN: Width and height can be defined in pixels or percent.
107 |
108 |
109 | Beispiele / Examples:
110 | const intPartyLogosImgWidth = 50;
111 | const intPartyLogosImgHeight = 25;
112 |
113 | const intPartyLogosImgWidth = "10%";
114 | const intPartyLogosImgHeight = "10%";
115 |
116 | const intPartyLogosImgWidth = 50;
117 | const intPartyLogosImgHeight = "";
118 |
119 | */
120 |
121 | const intPartyLogosImgWidth = "10%";
122 | const intPartyLogosImgHeight = "10%";
123 |
124 |
125 | // --------------------------------------------------------------------
126 |
127 |
128 | // 1.6. UeBERSCHRIFTEN UND TEXTE / 1.6. HEADLINES AND TEXTS:
129 |
130 | // 1.6.1 Soll am Anfang eine kurze Beschreibung angezeigt (1) werden oder sollen gleich die Fragen (0) starten?
131 | // Wenn die Fragen sofort starten, gibt es einen kurzen "Loading"-Hinweis. :(
132 | // Show a short description in the beginning (1) or start with the questions right (0) away?
133 | // If you choose for the questions right away, a short "loading" message will appear. :(
134 |
135 | const descriptionShowOnStart = 1;
136 |
137 | // 1.6.2. Hauptueberschrift / 1.6.1. Main headline
138 |
139 | const descriptionHeading1 = "Fruchtkorbwahlen";
140 |
141 |
142 | // 1.6.3. Zweite Ueberschrift / 1.6.2. Second Headline
143 |
144 | const descriptionHeading2 = "Die Wahl zur neuen Regierung in Obsthausen";
145 |
146 |
147 | // 1.6.4. Kurzer Text um was es bei der Wahl geht / 1.6.3. Short (descriptive) text on what's the election about
148 |
149 | const descriptionExplanation = "Am 30. Februar finden in Obsthausen Wahlen statt. Sie können sich hier alle Parteipositionen anschauen und miteinander vergleichen. Dies ist keine Wahlempfehlung, sondern ein Informationsangebot zu Wahlen! Zur Auswahl stehen vier Parteien mit unterschiedlichen Meinungen zu kontroversen Themen der Obst- und Frucht-Landschaft.";
150 |
151 |
152 | // --------------------------------------------------------------------
153 |
154 | /*
155 | 1.7. IMPRESSUM, KONTAKT: 1.7. LEGAL NOTICE, CONTACT:
156 |
157 | 1.7.A
158 |
159 | DE: Option A) Eigenes Impressum (empfohlen) -> Link anpassen und Option B ignorieren!
160 | Muster finden Sie z.B. auf: http://www.e-recht24.de/ oder http://www.datenschutz-generator.de/
161 |
162 | empfohlener Hinweis bei einem eigenen Impressum:
163 | "Der XXXXX-o-Mat basiert auf dem www.Mat-O-Wahl.de von Mathias Steudtner und ist freie Software unter GPL 3 Lizenz."
164 |
165 | ********************************************************************
166 |
167 | EN: Option A) Own legal notice (recommended) -> change link and ignore option B!
168 |
169 |
170 | */
171 |
172 | const imprintLink = "system/imprint.html"
173 |
174 |
175 | // --------------------------------------------------------------------
176 |
177 | /*
178 |
179 | DE: Option B) (Standard)-Mat-o-Wahl-Impressum.
180 | Wenn Sie keine (oder eigene) Angaben machen, so lassen Sie bitte die Variablen stehen.
181 | Loeschen Sie stattdessen einfach den Text, z.B.
182 | const imprintVATid = `` oder const imprintVATid = "";
183 |
184 | ********************************************************************
185 |
186 | EN: Option B) Use (default) legal notice of Mat-o-Wahl.
187 | If you prefer to leave these information blank, please do not delete these lines
188 | but only its content, e.g.
189 | const imprintVATid = `` or const imprintVATid = "";
190 |
191 | */
192 |
193 | // 1.7.B.1: Allgemeines. "Angaben gemäß § 5 TMG" / General information
194 |
195 | const imprintGeneral = `
Muster e. V.
196 | Musterstraße 111
197 | Gebäude 44
198 | 90210 Musterstadt
`;
236 |
237 |
238 | // 1.7.B.6
239 | // (optional) Technik: Person(en), die das System aufgesetzt hat
240 | // (optional) Programming: Person(s), who set up the system
241 |
242 | const imprintProgramming = `
Bilder mit freundlicher Genehmigung von / Pictures with permission from:
251 | Max Mustermann, Foto Franz Frankfurt, Neutrale Partei
252 | Äpfel: Von Glysiak - Eigenes Werk, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=8146365
253 | Bananen: Von Steve Hopson, www.stevehopson.com, CC BY-SA 2.5, https://commons.wikimedia.org/w/index.php?curid=1541726
254 | Zitronen: Von André Karwath aka Aka - Eigenes Werk, CC BY-SA 2.5, https://commons.wikimedia.org/w/index.php?curid=59992 `;
255 |
256 |
257 | // 1.7.B.8
258 | // (optional) Link zu einer Datenschutzerklaerung beginnend mit http(s):- erlaubt die anonyme Statistik
259 | // (optional) Link to a privacy policy starting with http(s):- allows the anonymous statistics
260 |
261 | const imprintPrivacyUrl = "https://www.hans-wurst-webdesign-obsthausen.com/datenschutz.html";
262 |
263 |
264 | // --------------------------------------------------------------------
265 |
266 |
267 | ///////////////////////////////////////////////////////////////////////
268 |
269 | // 2. ERWEITERTE EINSTELLUNGEN: / 2. ADVANCED SETTINGS
270 |
271 | // 2.1. Trennzeichen fuer die CSV-Dateien (Excel benutzt haeufig Semikolon, OpenOffice/LibreOffice ein Komma)
272 | // 2.1. Separator for CSV files (Excel uses often a semicolon, OpenOffice/LibreOffice a comma)
273 |
274 | const separator = ";";
275 |
276 |
277 | /*
278 | 2.2. CSS-Designvorlage(n)
279 |
280 | Der Mat-o-Wahl nutzt das "Bootstrap"-Framework für mobile Ansichten.
281 | Alle Standard-Bootstrap-Einstellungen können aber überschrieben werden.
282 | Die Dateien finden sich im Ordner /STYLES.
283 | Beispiele für das DESIGN-Aray:
284 |
285 | ********************************************************************
286 |
287 | const design = ["default.css","buttons-colors-on.css", "progressbar.css"];
288 | const design = ["default.css","buttons-colors-off.css", "progressbar.css"];
289 | const design = ["default.css","buttons-colors-on.css"];
290 | const design = ["my-personal-styles.css"];
291 |
292 | ********************************************************************
293 |
294 | 2.2. CSS-Design(s)
295 |
296 | Mat-o-Wahl uses the "bootstrap" framework for responsive design.
297 | All default settings can be overwritten.
298 | You can find the files in the /STYLES folder.
299 | Please find some examples above.
300 | */
301 |
302 | const design = ["default.css","buttons-colors-on.css", "progressbar.css"];
303 |
304 |
305 | /*
306 | 2.3. Add-ons / Plug-Ins / Extras
307 |
308 | Man kann eigene und fremde Addons einbinden.
309 | Einige Beispiele liegen im Ordner /EXTRAS.
310 | Die Einstellungen finden sich üblicherweise innerhalb den dortigen Dateien.
311 | Beispiele für das ADDONS-Aray:
312 |
313 | ********************************************************************
314 |
315 | const addons = ["extras/addon_results_textfilter_by_button.js"]
316 | const addons = ["extras/addon_results_textfilter_by_button.js", "extras/addon_check_iframe_resize_client.js", "extras/addon_limit_results.js", "extras/addon_favorite_party.js", "extras/addon_show_first_results.js"]
317 | const addons = []
318 | const addons = ["my_folder/my_file.js"]
319 |
320 | ********************************************************************
321 |
322 | 2.3. Add-ons / Plug-Ins / Extras
323 |
324 | You can include your own and external add-ons.
325 | Some examples are in the folder /EXTRAS.
326 | The settings are usually inside the corresponding files.
327 | Please find some examples above.
328 |
329 | */
330 |
331 | const addons = []
332 |
333 |
334 | // 2.4 Sprache / Language
335 | // see files in folder /i18n/
336 |
337 | const language = "de";
338 |
339 |
340 | ///////////////////////////////////////////////////////////////////////
341 |
342 | /*
343 | 3. PROFESSIONELLE EINSTELLUNGEN:
344 | 3. PROFESSIONAL SETTINGS
345 |
346 | DE: STATISTIK
347 | Anonyme Auswertung zulassen: true/1 oder false/0
348 | Die Einwilligung des Nutzers und eine Datenschutzerklaerung (s.o.) werden benoetigt! (*)
349 | Als Ergebnis erhaelt man die Liste mit der persoenlichen Auswahl in der Variablen "mowpersonal" (-1,0,1,99)
350 | und die Liste mit der Anzahl der Uebereinstimmungen mit den Parteien als "mowparties" (5,1,0,2) zurueck.
351 | Als Trennzeichen fuer die Werte dient wieder ein Komma. ;-)
352 | Das Skript und der Mat-O-Wahl sollten auf der gleichen Domain und Netzwerk-Protokoll liegen. (kein "cross origin" / CORS)
353 |
354 | ********************************************************************
355 |
356 | EN: STATISTICS
357 | Allow anonymous analysis: true/1 or false/0
358 | Consent of the user and a privacy policy are needed! (*)
359 | As a result you'll get the list of personal choices in a variable "mowpersonal" (-1,0,1,99)
360 | and a list with the number of party-matches as "mowparties" (5,1,0,2).
361 | Separator for these variables is a comma gain. ;-)
362 | The script and Mat-O-Wahl must be on the same domain and network-protocoll. (no "cross origin" / CORS)
363 | */
364 |
365 | const statsRecord = 0;
366 | const statsServer = "http://localhost/extras/statistics/vote_txt.php";
367 |
368 |
369 | /*
370 | -> POST-Aufruf der gesendeten Ergebnisse / POST-Call of sent results:
371 | http://localhost/extras/statistics/vote_txt.php?mowpersonal=-1,0,1,99&mowparties=5,1,0,2
372 |
373 | (*) In der OUTPUT.JS etwa auf Zeile 60 kann man die Checkbox automatisch als
374 | "checked" / angeklickt definieren. Das entspricht dem Opt-In Verfahren.
375 |
376 | (*) In OUTPUT.JS at around line 60 you can define the checkbox as "checked".
377 | This would be an opt-in method.
378 | */
379 |
--------------------------------------------------------------------------------
/data/egal2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msteudtn/Mat-O-Wahl/a0322f949e5a13082813e5410dae520931e31a4d/data/egal2.jpg
--------------------------------------------------------------------------------
/data/tbc2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msteudtn/Mat-O-Wahl/a0322f949e5a13082813e5410dae520931e31a4d/data/tbc2.jpg
--------------------------------------------------------------------------------
/docker-compose-dev.yml:
--------------------------------------------------------------------------------
1 | services:
2 | mat-o-wahl:
3 | container_name: mat-o-wahl
4 | build: .
5 | restart: always
6 | ports:
7 | - "80:80"
8 | volumes:
9 | - ./data:/var/www/html/data
10 | - ./extras:/var/www/html/extras
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | mat-o-wahl:
3 | container_name: mat-o-wahl
4 | image: ghcr.io/msteudtn/mat-o-wahl:latest # you can also use the dockerhub image msteudtn/mat-o-wahl:latest
5 | restart: always
6 | ports:
7 | - "80:80"
8 | volumes:
9 | - ./data:/var/www/html/data
10 | - ./extras:/var/www/html/extras
--------------------------------------------------------------------------------
/extras/addon_check_iframe_resize_client.js:
--------------------------------------------------------------------------------
1 | /*
2 | // EINSTELLUNGEN / SETTINGS
3 | // http://www.mat-o-wahl.de
4 |
5 | /* EINSATZZWECK / USE CASE
6 |
7 | * WENN der Mat-o-Wahl als
";
65 | $conn->close();
66 |
67 |
68 | // DE: Sichergehen, dass die Datei existiert und beschreibbar ist
69 | // EN: Let's make sure the file exists and is writable first.
70 | if (is_writable($filename)) {
71 |
72 | // DE: Wir öffnen $filename im "WRITE" - Modus, so dass die Datei neu geschrieben wird.
73 | // EN: In our example we're opening $filename in WRITE mode to write it new.
74 | if (!$handle = fopen($filename, "w")) {
75 | print " Cannot open file ($filename) ";
76 | exit;
77 | }
78 |
79 | // DE: Schreibe $somecontent in die geöffnete Datei.
80 | // EN: Write $somecontent to our opened file.
81 | if (!fwrite($handle, $somecontent)) {
82 | print " Cannot write to file $filename ";
83 | exit;
84 | }
85 |
86 | print "Success! wrote: ($somecontent) to file ($filename)";
87 |
88 | fclose($handle);
89 |
90 | } else {
91 | print " The file $filename is not writable ";
92 | }
93 |
94 | echo "
You can now change the `var fileResults` in /SYSTEM/RESULTS.JS to ".$filename." "
95 |
96 |
97 | ?>
98 |
--------------------------------------------------------------------------------
/extras/statistics_db/readme.md:
--------------------------------------------------------------------------------
1 |
2 | # read_db_write_text.php
3 |
4 | :de: Das PHP-Skript liest die **Ergebnisse des Mat-o-Wahl aus der Datenbank** aus und **speichert sie in der Textdatei** `results_db.txt`
5 |
6 | Es kann einfach im Browser aufgerufen werden, z.B. www.unser-buergerverein-in-stadtname.de/wahlcheck/extras/statistics_db/read_db_write_text.php
7 |
8 | Die **Zugangsdaten zur Datenbank** werden automatisch aus `/EXTRAS/STATISTICS/DB_SETTINGS.PHP` ausgelesen. (Es sind die gleichen Zugangsdaten, wie zum Schreiben in die Datenbank.)
9 | Die Zugangsdaten müssen natürlich an die eigenen Bedürfnisse angepasst werden. :)
10 |
11 | Die Textdatei `results_db.txt` kann dann als **Datei-Quelle** `var fileResults` in die `/SYSTEM/RESULTS.JS` eingetragen werden.
12 |
13 | ---
14 |
15 | :us: The PHP-script reads the **results of Mat-o-Wahl from the database** and **saves it into the text-file** `results_db.txt`
16 |
17 | It can be called from a browser, e.g. www.unser-buergerverein-in-stadtname.de/wahlcheck/extras/statistics_db/read_db_write_text.php
18 |
19 | The **credentials to the database** are read from `/EXTRAS/STATISTICS/DB_SETTINGS.PHP`. (It's the same as with writing the statistics.)
20 | Obviously you have to adapt it to your needs. :)
21 |
22 | The text-file `results_db.txt` can later be uses as **source file** `var fileResults` in `/SYSTEM/RESULTS.JS`.
23 |
24 |
25 | # htaccess, htpasswd
26 |
27 | :de: Man **kann** seine Ergebnisse mit einem Passwort vor fremden Zugriffen schützen. Andernfalls hat jeder Besucher Zugriff auf die Statistik-Textdatei (das kann aber auch natürlich genauso gewollt sein).
28 |
29 | Dazu bitte wie folgt vorgehen:
30 |
31 | * Der aktuelle Nutzername heißt `mow` und das aktuelle Passwort lautet ebeneso `mow`. Diese müssen noch geändert werden.
32 |
33 | * Entweder: Auf einem System mit installierten Apache-Server (oder auf dem eigenen Web-Server, z.B. per SSH-Zugriff) den folgenden Befehl ausführen. `htpasswd -c -B htpasswd NUTZERNAME`. Dies fragt nach dem Passwort für den Nutzer "NUTZERNAME" und schreibt das Passwort in die Datei "htpasswd".
34 | * Oder: Einen Online-Service für das Passwort-Erstellen nutzen, wie z.B. https://www.redim.de/blog/passwortschutz-mit-htaccess-einrichten oder https://hostingcanada.org/htpasswd-generator/ Das Ergebnis muss dann in die "htpasswd"-Datei eingetragen werden.
35 |
36 | * Den Beispiel-Pfad zum Verzeichnis `/var/www/htdocs/mat-o-wahl/extras/statistics_db/.htpasswd` muss mit dem richtigen Pfad aus der eigenen Server-Konfiguration angepasst werden.
37 |
38 | * Der Pfad zum eigenen Skript wird in der `READ_DB_WRITE_TEXT.PHP` am Anfang angezeigt.
39 |
40 | * Die htpasswd-Datei sollte nicht im gleichen Ordner liegen, wie die htaccess-Datei, sondern woanders, z.B. außerhalb des Web-Bereichs, z.B. `/var/www/geheim/.htpasswd`
41 |
42 | * Die beiden Dateien `htaccess` und `htpasswd` müssen noch umbenannt werden. Es muss ein Punkt an den Anfang gestellt werden, so dass sie unter Linux-Systemen als versteckte Dateien ausgeblendet werden, also `.htaccess` und `.htpasswd`. Wenn das unter Windows nicht funktioniert, kann man es nach dem Hochladen auf dem Server erledigen (z.B. mit dem FTP-Programm)
43 |
44 | ---
45 |
46 | :us: You **can** protect your results with a password from unauthorized access. Otherwise anybody can access your statistics-text-file. (But maybe you would like to have public access and this doesn't concern you.)
47 |
48 | * This folder has two example files `htaccess` and `htpasswd`.
49 | * They have to be renamed to `.htaccess` and `.htpasswd` ...
50 | * ... and the password has to be replaced (currently username and password are both `mow`)
51 | * ... and the pathname in `htaccess` has to be adjusted
52 | * ... and they have to be uploaded.
53 |
--------------------------------------------------------------------------------
/extras/statistics_db/results_db.txt:
--------------------------------------------------------------------------------
1 | 127.0.0.1 2021-05-14 11:15:04 1,1,1,1,1,1 4.5,2,2,3
2 | 127.0.0.1 2021-05-14 11:16:09 1,-1,-1,-1,-1,1 1.5,6,4,3
3 | 127.0.0.1 2021-05-14 11:38:53 -1,1,1,1,1,-1 4.5,0,2,3
4 | 127.0.0.1 2021-05-14 13:02:04 0,2,-1,-1,-1,2 5,5.5,5.5,4.5
5 | 0.0.0.0 2021-07-04 -1,0,1,99 5,1,0,2
6 | 0.0.0.0 2021-07-04 -1,0,1,99 5,1,0,2
7 | 0.0.0.0 2021-07-04 -1,0,-1,99 5,1,0,2
8 | 0.0.0.0 2021-07-04 1,0,-1,2,0,-2 2.5,3.5,5.5,6
9 | 0.0.0.0 2021-07-04 -1,0,-1,99 5,1,0,2
10 | 0.0.0.0 2021-07-04 0,0,0,0,0,0 3.5,3,3,6
11 |
--------------------------------------------------------------------------------
/i18n/i18n_de.js:
--------------------------------------------------------------------------------
1 | // DEUTSCHE TEXTE http://www.mat-o-wahl.de
2 |
3 | // Buttons
4 | var TEXT_START = "Los geht's!"
5 | var TEXT_VOTING_PRO = "Stimme zu"
6 | var TEXT_VOTING_NEUTRAL = "Egal/Weiß nicht"
7 | var TEXT_VOTING_CONTRA = "Stimme nicht zu"
8 | var TEXT_VOTING_SKIP = "Überspringen"
9 | var TEXT_VOTING_DOUBLE = "Doppelt gewichten"
10 |
11 | // Statistic
12 | var TEXT_ALLOW_STATISTIC = "Anonyme Auswertung (Wahlprognose) erlauben. Siehe Datenschutzerklärung." // Variable loeschen!
13 |
14 | var TEXT_ALLOW_STATISTIC_TITLE = "Bevor dein Ergebnis erscheint ..."
15 | var TEXT_ALLOW_STATISTIC_TEXT = "Genehmigst du uns (den Betreibern dieser Seite) die Übertragung deiner anonymisierten Antworten für statistische Zwecke gemäß unserer Datenschutzerklärung? Damit hilfst du uns, den Mat-o-Wahl und die Fragen in Zukunft zu verbessern."
16 | var TEXT_ALLOW_STATISTIC_YES = "Ja, na klar!"
17 | var TEXT_ALLOW_STATISTIC_NO = "Nein, danke."
18 |
19 | // Footer
20 | var TEXT_IMPRINT = "[§] Impressum"
21 | var TEXT_RESTART = "[↻] Fragebogen neu starten"
22 |
23 | // Results
24 | var TEXT_RESULTS_HEADING = "Übereinstimmung mit den Positionen"
25 |
26 | var TEXT_RESULTS_INFO_THESES = "Sie können Ihre eigene Meinung in der zweiten Spalte noch einmal anpassen und das neue Ergebnis überprüfen. Die Antworten der Parteien erhalten Sie beim Klick auf das Plus-Zeichen."
27 | var TEXT_RESULTS_INFO_PARTIES = "Dies ist eine Übersicht aller Parteien und ihrer Antworten."
28 |
29 | var TEXT_RESULTS_BUTTON_THESES = "Begründungen - Fragen und Antworten anzeigen"
30 | var TEXT_RESULTS_BUTTON_PARTIES= "Standpunkte - Parteien und Antworten anzeigen"
31 |
32 | // The following words may be used as ALT-Text or headers on the results-page
33 | var TEXT_QUESTION = "Frage"
34 | var TEXT_POSITION_PARTY = "Position der Partei"
35 | var TEXT_ANSWER_PARTY = "Antwort der Partei"
36 | var TEXT_ANSWER_USER = "Ihre Antwort"
37 | var TEXT_IMAGE = "Logo oder Bild"
38 | var TEXT_PARTY = "Partei"
39 | var TEXT_ANSWER_NORMAL = "Frage einfach gewertet"
40 | var TEXT_ANSWER_DOUBLE = "Frage doppelt gewertet"
41 |
--------------------------------------------------------------------------------
/i18n/i18n_en.js:
--------------------------------------------------------------------------------
1 | // ENGLISH LANGUAGE TEXTS http://www.mat-o-wahl.de
2 |
3 | // Buttons
4 | var TEXT_START = "Let's start"
5 | var TEXT_VOTING_PRO = "Agree"
6 | var TEXT_VOTING_NEUTRAL = "No opinion"
7 | var TEXT_VOTING_CONTRA = "Disagree"
8 | var TEXT_VOTING_SKIP = "Skip (don't count)"
9 | var TEXT_VOTING_DOUBLE = "Very important to me"
10 |
11 | // Statistic
12 | var TEXT_ALLOW_STATISTIC = "Allow anonymous analytics (prognosis)? See privacy statement." // to be deleted
13 |
14 | var TEXT_ALLOW_STATISTIC_TITLE = "Before we'll show your results ..."
15 | var TEXT_ALLOW_STATISTIC_TEXT = "Will you allow to use anonymous data for statistics according to our privacy statement? This helps us (the owner(s) of this site) to improve this application."
16 | var TEXT_ALLOW_STATISTIC_YES = "Yes, sure"
17 | var TEXT_ALLOW_STATISTIC_NO = "No, thanks."
18 |
19 | // Footer
20 | var TEXT_IMPRINT = "[§] Legal Notice"
21 | var TEXT_RESTART = "[↻] Restart questionnaire"
22 |
23 | // Results
24 | var TEXT_RESULTS_HEADING = "Your matches with the different positions"
25 |
26 | var TEXT_RESULTS_INFO_THESES = "You can adjust your own opinion in the second row and reevaluate the result. Answers to the questions are shown on click on the corresponding question."
27 | var TEXT_RESULTS_INFO_PARTIES = "Analysis"
28 |
29 | var TEXT_RESULTS_BUTTON_THESES = "Questions and answers of parties"
30 | var TEXT_RESULTS_BUTTON_PARTIES= "All answers of the parties"
31 |
32 | // The following words may be used as ALT-Text or headers on the results-page
33 | var TEXT_QUESTION = "Question"
34 | var TEXT_POSITION_PARTY = "Opinion of party"
35 | var TEXT_ANSWER_PARTY = "Answer of party"
36 | var TEXT_ANSWER_USER = "Your answer"
37 | var TEXT_IMAGE = "picture or logo"
38 | var TEXT_PARTY = "Party"
39 | var TEXT_ANSWER_NORMAL = "Question in single rating"
40 | var TEXT_ANSWER_DOUBLE = "Question in double rating"
41 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
99 | DE: Wenn Sie das hier lesen können, dann haben Sie in der Schule aufgepasst und dann ist hier irgendetwas schief gelaufen.
100 | Bitte laden Sie die Seite noch einmal neu.
101 | Wenn die Meldung immer noch erscheint, muss wohl der Techniker informiert werden.
102 |
103 | EN: If you can read this, you didn't sleep during school and something went wrong.
104 | Please reload the page and try again.
105 | If the message still appears, we have to call the technician.
106 |
107 |
108 | Kurze Beschreibung der Wahl, wer wird gewählt, wann, warum, für wie lange, usw. Short (explaining) text on what's the election about
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
Header
137 |
138 |
Frage(n) zu den verschiedenen Positionen an die Parteien bzw. Kandidaten.
139 | Question(s) on the different party/candidate positions.
Mat-O-Wahl - Konfigurationstest / Configuration test
56 |
57 |
58 |
59 | DE: Dieser Test liest alle wichtigen Einstellungen aus und liefert so einen schnellen Überblick,
60 | ob man vielleicht einen Fehler in der Konfiguration gemacht hat.
61 |
62 |
63 | EN: This test reads all important settings and gives you a quick overview if there's a mistake in the configuration.
64 |
65 |
66 |
67 |
Fehlerbericht / Error Report
68 |
69 |
70 |
71 |
76 |
77 |
78 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | DE: Wenn diese Meldung auch nach mehreren Minuten nicht verschwindet und JavaScript aktiviert ist, haben Sie entweder einen sehr langsamen Rechner,
90 | einen sehr umfangreichen Fragebogen oder ein echtes Problem in den Definitions-Dateien.
91 | z.B. eine Einstellung, die nicht sauber mit "Anführungszeichen" eingeschlossen ist
92 | oder eine fehlende Einstellung. Zum Beispiel:
93 |
94 |
95 | Falsch: Fehlendes Anführungszeichen am Anfang oder Ende.
96 | var fileQuestions = Fragen.csv";
97 | var fileQuestions = "Fragen.csv;
98 |
99 | Falsch: Eine vollkommen fehlende Einstellung.
100 | var fileQuestions =
101 |
102 | Falsch: Eine Datei ohne Dateiendung (obwohl diese vorhanden ist) oder Groß- und Kleinschreibung. Dateiendungen werden im Windows-Explorer normalerweise ausgeblendet. :(
103 | var fileQuestions = "Fragen";
104 |
105 | Richtig:
106 | var fileQuestions = "Fragen.csv";
107 |
108 |
109 |
110 | EN: If this message is still showing after some minutes and JavaScript is active, you have either a very slow computer, a very complex questionnaire or a real problem with the preferences like
111 | a setting, that is not enclosed by "quotes" or one of the following wrong settings:
112 |
113 |
114 | Wrong: Missing quote at the beginning or end.
115 | var fileQuestions = Fragen.csv";
116 | var fileQuestions = "Fragen.csv;
117 |
118 | Wrong: A missing setting
119 | var fileQuestions =
120 |
121 | Wrong: A file without file extension (even thoug it exists) or a confusion with capital letters. Windows-Explorer usually hides the file extensions. :(
122 | var fileQuestions = "Fragen";
123 |
124 | Right:
125 | var fileQuestions = "Fragen.csv";
126 |
127 |
128 |
129 |
Beschreibungen / Descriptions
130 |
131 |
132 |
133 | Bitte warten, bis alle Berechnungen beendet sind ... / Please wait until all calculations are finished ...
134 |
135 |
136 |
137 |
138 |
Fragen / Questions
139 |
140 |
141 |
142 | Bitte warten, bis alle Berechnungen beendet sind ... / Please wait until all calculations are finished ...
143 |
144 |
145 |
146 |
Antworten der Parteien und Partei-Informationen / Party answers and information
147 |
148 |
149 |
150 | Bitte warten, bis alle Berechnungen beendet sind ... / Please wait until all calculations are finished ...
151 |
152 |
153 |
154 |
Kontakt- und Impressumsdaten / Contact and Legal Notice
155 |
156 |
157 |
158 | Bitte warten, bis alle Berechnungen beendet sind ... / Please wait until all calculations are finished ...
159 |
172 |
173 |
184 |
185 |
186 |
187 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | *ENGLISH DESCRIPTION at the end of the German text*
2 |
3 | # Mat-O-Wahl - Ein einfach zu bedienender, freier Wahl-O-Mat Klon für jedermann
4 |
5 | ## LIVE-DEMO
6 |
7 | https://www.mat-o-wahl.de/ -> Ausprobieren (DE) :beer:
8 |
9 | ## BEDIENUNG / INSTALLATION
10 |
11 | ### Installation ohne Docker
12 | 1. ZIP-Archiv **herunterladen und entpacken**
13 | (Github -> oben rechts -> Code -> Download ZIP)
14 |
15 | 2. Datei `/DATA/DEFINITION.JS` in einem **Texteditor (am besten mit Syntaxhervorhebung) bearbeiten**.
16 |
17 | 3. `Fragen- und Antworten-CSV`-Datei in einem **Texteditor oder einer Tabellenkalkulation (MS Excel, LO Calc, ...) bearbeiten**. Der Dateiname kann frei gewählt werden.
18 |
19 | 4. **Testen mit `INDEX.HTML`** oder `QUICKTEST.HTML`
20 | (am besten auf http://localhost/ oder im privaten Webspace)
21 |
22 | **Optional:** Im Ordner `/EXTRAS` gibt es **Erweiterungen** um bei Bedarf zusätzliche Funktionen zu aktivieren. (z.B. Filtern von Ergebnissen, Vorabfrage, Einbinden per iframe)
23 |
24 | ### Installation mit Docker
25 | #### Nutzung des fertigen Images
26 |
27 | 1. installiere [docker](https://docs.docker.com/engine/install/) und docker-compose
28 |
29 | 2. lade die docker-compose.yml runter
30 |
31 | 3. passe die Parameter für deine zwecke an
32 | - **Image:** Wähle aus, ob du eine spezielle Version verwenden möchtest.
33 | - **Port:** Ändere den Port, falls Port 80 bereits belegt ist.
34 | - **Volumes:** Passe den Pfad deiner Konfigurationsdateien an (Standard: `./data`).
35 |
36 | 4. starte den Service mit `docker-compose up` (du kannst den Service mit `docker-compose down` stoppen)
37 |
38 | #### Baue das image selber
39 |
40 | 1. installiere [docker](https://docs.docker.com/engine/install/) und docker-compose
41 |
42 | 2. ZIP-Archiv **herunterladen und entpacken**
43 | (Github -> oben rechts -> Code -> Download ZIP)
44 |
45 | 3. passe die Parameter für deine zwecke in der `docker-compose-dev.yml` an
46 | - **Image:** Wähle aus, ob du eine spezielle Version verwenden möchtest.
47 | - **Port:** Ändere den Port, falls Port 80 bereits belegt ist.
48 | - **Volumes:** Passe den Pfad deiner Konfigurationsdateien an (Standard: `./data`).
49 |
50 | 4. starte den Service mit `docker-compose -f docker-compose-dev.yml up` (du kannst den Service mit `docker-compose down` stoppen)
51 |
52 | ## VORAUSSETZUNG
53 |
54 | - ein bisschen **Webspace** (ein günstiges Shared-Hosting-Paket reicht vollkommen aus)
55 | - **kein** PHP oder MySQL / MariaDB nötig (nur optional für Statistik)
56 | - **kein** npm, yarn oder eine andere Paketverwaltung nötig
57 | - Wissen, wie man eine **Textdatei** und/oder eine Tabellenkalkulation öffnet
58 |
59 | ## Mat-o-Wahl und DSGVO
60 |
61 | - Alle **Verarbeitungen** passieren **innerhalb des Browsers** des Nutzers
62 | - **keine Datenerhebung auf dem Server** (nur optional für eine Statistik - Ausnahme: Standardmäßige Erfassung der Zugriffe durch den Webhosting-Anbieter, z.B. IP-Adresse und Uhrzeit)
63 | - kein Aufruf von externen Dateien (z.B. Content Delivery Network / CDN, Bootstrap, jQuery, kein Social Media-Plugin) - alles inklusive
64 |
65 | ## LIZENZ
66 |
67 | GPL 3 (siehe Verzeichnis /SYSTEM oder http://choosealicense.com/licenses/gpl-v3/)
68 | - Quellcode, Lizenz und größere Änderungen müssen kenntlich gemacht werden.
69 | - Änderungen, Weitergabe, sowie kommerzielle und private Nutzung erlaubt.
70 | - Keine Garantie für Softwareschäden.
71 |
72 | ## HILFE / KONTAKT / ÄNDERUNGEN
73 |
74 | - Weitere Informationen und Dokumentation online unter https://www.mat-o-wahl.de
75 | - oder per E-Mail (siehe unten).
76 | - Änderungen zu den Vorgängerversionen finden sich im Changelog https://github.com/msteudtn/Mat-O-Wahl/blob/master/system/changelog.md
77 |
78 | Wenn Sie den Mat-O-Wahl einsetzen, würde ich mich über eine **kurze Mitteilung von Ihnen** freuen.
79 |
80 | mathias . steudtner (a) mailbox . org
81 |
82 | ---
83 |
84 | # Mat-O-Wahl (*) - A simple to handle, free "Voting Advice Application" / "Electoral Compass" for everybody
85 |
86 | ## LIVE-DEMO
87 |
88 | https://www.mat-o-wahl.de/ -> Try It (EN) :hamburger:
89 |
90 | ## USE / INSTALLATION
91 |
92 | ### Installation without Docker
93 | 1. **Download and unpack** ZIP archive
94 | (Github -> top right -> Code -> Download ZIP)
95 |
96 | 2. **Edit** `/DATA/DEFINITION.JS` with a text-editor (best use one with syntax-highlighting).
97 |
98 | 3. **Edit** `CSV-text file` for questions and answers with a text-editor or spread-sheet-software (MS Excel. LO Calc, ...)
99 |
100 | 4. **Test settings** using `INDEX.HTML` or `QUICKTEST.HTML`
101 | (works best on http://localhost/ or your private webspace)
102 |
103 | **Optional:** You can find some **extensions** in the folder `/EXTRAS`. It adds some more functionality to the program, if needed. (e.g. filter of results, pre-question, include the program within an iframe)
104 |
105 | ### Installation with Docker
106 |
107 | #### Using the Prebuilt Image
108 |
109 | 1. Install [Docker](https://docs.docker.com/engine/install/) and Docker Compose.
110 |
111 | 2. Download the `docker-compose.yml` file.
112 |
113 | 3. Adjust the parameters to suit your needs:
114 | - **Image:** Choose whether you want to use a specific version.
115 | - **Port:** Change the port if port 80 is already in use.
116 | - **Volumes:** Adjust the path of your configuration files (default: `./data`).
117 |
118 | 4. Start the service with `docker-compose up` (you can stop the service with `docker-compose down`).
119 |
120 | #### Build the Image Yourself
121 |
122 | 1. Install [Docker](https://docs.docker.com/engine/install/) and Docker Compose.
123 |
124 | 2. **Download and extract the ZIP archive**
125 | (GitHub -> Top right -> Code -> Download ZIP).
126 |
127 | 3. Adjust the parameters in `docker-compose-dev.yml` to suit your needs:
128 | - **Image:** Choose whether you want to use a specific version.
129 | - **Port:** Change the port if port 80 is already in use.
130 | - **Volumes:** Adjust the path of your configuration files (default: `./data`).
131 |
132 | 4. Start the service with: `docker-compose -f docker-compose-dev.yml up` (You can stop the service with `docker-compose down`).
133 |
134 | ## PREREQUISITES
135 |
136 | - some **web-space** (a cheap shared-hosting plan is sufficient)
137 | - **no** PHP or MySQL / MariaDB needed (optional for statistics)
138 | - **no** npm or any other packaging manager needed
139 | - knowing, how to **open a text-file** and/or a spread-sheet-software
140 |
141 | ## Mat-o-Wahl and GDPR
142 |
143 | - All **evaluations** happen **inside the user's browsers**
144 | - **No data** is collected **on a server** (optional for statistics - Exception: default access-logging by your webhosting-provider, i.e. IP-address and time)
145 | - No external files (e.g. Content Delivery Network / CDN, Bootstrap, jQuery, no Social Media-plugin) - all included
146 |
147 | ## LICENSE
148 |
149 | GPL 3 (see folder /SYSTEM or http://choosealicense.com/licenses/gpl-v3/)
150 | - Required: Disclose Source, License and copyright notice, State Changes
151 | - Permitted: Commercial Use, Distribution, Modification, Patent Use, Private Use
152 | - Forbidden: Hold Liable
153 |
154 | ## HELP / CONTACT / CHANGELOG
155 |
156 | - You can find further information and documentation on-line at https://www.mat-o-wahl.de
157 | - or via email (see below)
158 | - Changes to earlier versions in the changelog https://github.com/msteudtn/Mat-O-Wahl/blob/master/system/changelog.md
159 |
160 | If you should find Mat-O-Wahl useful, I would be happy about a **short notice from you** by email.
161 |
162 | mathias . steudtner (a) mailbox . org
163 |
164 | (*) derived from the German project "Wahl-O-Mat" (Wahl-Automat) / "Vote-Machine"
165 |
--------------------------------------------------------------------------------
/results.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Mat-O-Wahl - Results
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
Auswertung - Mat-O-Wahl
62 |
63 |
68 |
69 |
70 |
71 |
72 |
73 | Informationen zur Auswertung
74 |
75 |
76 |
77 |
78 |
79 |
Abstimmung zu den Parteien
80 |
81 |
82 |
83 |
84 |
85 | Bitte warten, bis alle Berechnungen beendet sind ...
86 |
87 |
88 |
89 |
90 |
91 |
Abstimmung zu den einzelnen Fragen
92 |
93 |
94 |
95 |
96 |
97 | Bitte warten, bis alle Berechnungen beendet sind ...
98 |
99 |
100 |
101 |
102 |
103 |
Abstimmung nach Tagen
104 |
105 |
106 |
107 |
108 |
109 | Bitte warten, bis alle Berechnungen beendet sind ...
110 |
120 |
121 |
122 |
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/styles/buttons-colors-off.css:
--------------------------------------------------------------------------------
1 | /* Bootstrap BUTTONS
2 | https://getbootstrap.com/docs/4.0/components/buttons/
3 |
4 | Anpassung: nur Rahmen, keine Farbe
5 | Adjustment: frame only, no colors */
6 |
7 |
8 | /* Transparenz auf alle Knöpfe
9 | Transparency on all buttons */
10 | .btn-success, .btn-warning, .btn-secondary, .btn-danger {
11 | color: #000;
12 | background: rgba(0, 0, 0, 0.0);
13 | border-color: #000;
14 | }
15 |
16 | /* dunkles Blau für helle Schrift / dark blue for light font
17 | für diverse Knöpfe / several buttons */
18 | .btn-primary {
19 | background:#0050A0;
20 | }
21 |
22 | /* schwarze Schrift für hellen Hintergrund / dark font for light background
23 | bei [+] [-] Knöpfen in den Ergebnistabellen / at the [+] [-] buttons in the results-tables */
24 | .btn-outline-secondary {
25 | color:#000;
26 | }
27 |
28 | /* Außenabstand / padding */
29 | .btn {
30 | margin: 0.5em;
31 | }
--------------------------------------------------------------------------------
/styles/buttons-colors-on.css:
--------------------------------------------------------------------------------
1 | /* Bootstrap BUTTONS
2 | https://getbootstrap.com/docs/4.0/components/buttons/
3 |
4 | Anpassung: WACG Farben (Barrierefreiheit)
5 | Adjustment: WACG colors (accessibility)
6 | https://webaim.org/resources/contrastchecker/ */
7 |
8 |
9 | /* [PRO] Knopf: dunkleres grün / [PRO] button: darker green */
10 | .btn-success {
11 | background: #126412;
12 | }
13 |
14 | /* [o] Knopf: schwarze Schrift auf gelbem Hintergrund / [o] button: black font on yellow background */
15 | .btn-warning {
16 | color:#000;
17 | }
18 |
19 | /* [CONTRA] Knopf: keine Änderung / [CONTRA] button: no change */
20 | .btn-danger {
21 | }
22 |
23 | /* diverse Knöpfe: dunkles Blau für helle Standardschrift / several buttons: dark blue for light default-fonts */
24 | .btn-primary {
25 | background:#0050A0;
26 | }
27 |
28 | /* [+] [-] Knöpfe zum Aufklappen: schwarze Schrift für hellen Hintergrund
29 | [+] [-] buttons to collapse tables: dark font for light background */
30 | .btn-outline-secondary {
31 | color:#000;
32 | }
33 |
34 | /* Außenabstand / padding */
35 | .btn {
36 | margin: 0.5em;
37 | }
38 |
--------------------------------------------------------------------------------
/styles/default.css:
--------------------------------------------------------------------------------
1 |
2 | /* BODY: Hintergrundfarbe, Schriftart, -groesse und -farbe */
3 | /* BODY: background color, font, size and color */
4 | body {
5 | font-family:Verdana, Arial, Helvetica, sans-serif;
6 | /* font-size:10pt; */
7 | color:#000000;
8 |
9 | background-color: #EFC04F;
10 | /* background-image: linear-gradient(#EFC04F, #FFE08F); */
11 | /* background-attachment: fixed; */
12 | }
13 |
14 | /* LINK-Farbe - AUSSER bei der Bootstrap-Klasse "btn" für Buttons. Dort wird der Bootstrap-Standard benutzt. */
15 | /* LINK-color - EXCEPT for Bootstrap button-class "btn". Use defaults there. */
16 | a:not(.btn) { color:#000000; text-decoration:underline;}
17 | a:not(.btn):link { color:#000000; }
18 | a:not(.btn):visited { color:#404040; }
19 | a:not(.btn):active { color:#FF0000; }
20 | a:not(.btn):hover { color:#FF0000; text-decoration:none; }
21 |
22 |
23 | /* Statistik */
24 | /* Statistics */
25 | #keepStats {
26 | margin-top:10px;
27 | font-size:90%;
28 | }
29 |
30 | /* Willkommensnachricht (erster DIV)
31 | Welcome Message (first DIV) */
32 | #sectionDescription > div:first-of-type {
33 | padding: 5% 2%;
34 | text-overflow: clip;
35 | overflow: auto;
36 | margin-top: 1.0em;
37 | max-height: 60vh;
38 | }
39 |
40 | /* BOOTSTRAP */
41 | .row {
42 | padding: 0.2em;
43 | }
44 |
45 | /* Gestreifte Spalten in den Ergebnis-Listen
46 | Striped rows in results */
47 | .mow-row-striped:nth-child(odd) {
48 | background-color: rgba(0, 0, 0, 0.05);
49 | }
50 |
51 |
52 | /* Social Media DIV und zugehoerige Buttons */
53 | /* Social media DIV and corresponding buttons */
54 | .social-facebook {
55 | background: #4560a3;
56 | color: #c0c0c0;
57 | }
58 |
59 | .social-twitter {
60 | background: #68ace3;
61 | color: #fff;
62 | }
63 |
64 | .social-mail {
65 | background: #c6c6c6;
66 | color: #fff;
67 | }
68 |
69 |
70 | /* FadeIn + FadeOut */
71 |
72 | @keyframes myFadeIn {
73 | from { opacity: 0; }
74 | to { opacity: 1; }
75 | }
76 |
77 | @keyframes myFadeOut {
78 | from { opacity: 1; }
79 | to { opacity: 0; }
80 | }
81 |
--------------------------------------------------------------------------------
/styles/progressbar.css:
--------------------------------------------------------------------------------
1 | /* Bootstrap PROGRESSBAR
2 | https://getbootstrap.com/docs/4.0/components/progress/
3 |
4 | Anpassung WACG Farben (Barrierefreiheit)
5 | Adjust WACG colors (accessibility)
6 | https://webaim.org/resources/contrastchecker/ */
7 |
8 |
9 | /* Grün in Ergebnis-Tabelle / Green in Results */
10 | .bg-success {
11 | background: #126412 !important;
12 | }
13 |
14 |
15 | /* Gelb in Ergebnis-Tabelle / Yellow in Results */
16 | .bg-warning {
17 | color:#000;
18 | }
19 |
20 | /* Rot in Ergebnis-Tabelle / Red in Results */
21 | .bg-danger {
22 | }
23 |
24 | /* Fortschrittsbalken über Fragen / Progressbar above questions */
25 | .bg-primary {
26 | background:#0050A0;
27 | }
28 |
29 | .progress {
30 | margin: 8px;
31 | }
32 |
--------------------------------------------------------------------------------
/system/License-MIT-jquery.txt:
--------------------------------------------------------------------------------
1 | Copyright 2014 jQuery Foundation and other contributors
2 | http://jquery.com/
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
23 | https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
24 |
--------------------------------------------------------------------------------
/system/Mat-O-Wahl-Hilfe.odt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msteudtn/Mat-O-Wahl/a0322f949e5a13082813e5410dae520931e31a4d/system/Mat-O-Wahl-Hilfe.odt
--------------------------------------------------------------------------------
/system/Mat-O-Wahl-Hilfe.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msteudtn/Mat-O-Wahl/a0322f949e5a13082813e5410dae520931e31a4d/system/Mat-O-Wahl-Hilfe.pdf
--------------------------------------------------------------------------------
/system/bootstrap4/css/bootstrap-reboot.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v4.4.1 (https://getbootstrap.com/)
3 | * Copyright 2011-2019 The Bootstrap Authors
4 | * Copyright 2011-2019 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */
8 | *,
9 | *::before,
10 | *::after {
11 | box-sizing: border-box;
12 | }
13 |
14 | html {
15 | font-family: sans-serif;
16 | line-height: 1.15;
17 | -webkit-text-size-adjust: 100%;
18 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
19 | }
20 |
21 | article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
22 | display: block;
23 | }
24 |
25 | body {
26 | margin: 0;
27 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
28 | font-size: 1rem;
29 | font-weight: 400;
30 | line-height: 1.5;
31 | color: #212529;
32 | text-align: left;
33 | background-color: #fff;
34 | }
35 |
36 | [tabindex="-1"]:focus:not(:focus-visible) {
37 | outline: 0 !important;
38 | }
39 |
40 | hr {
41 | box-sizing: content-box;
42 | height: 0;
43 | overflow: visible;
44 | }
45 |
46 | h1, h2, h3, h4, h5, h6 {
47 | margin-top: 0;
48 | margin-bottom: 0.5rem;
49 | }
50 |
51 | p {
52 | margin-top: 0;
53 | margin-bottom: 1rem;
54 | }
55 |
56 | abbr[title],
57 | abbr[data-original-title] {
58 | text-decoration: underline;
59 | -webkit-text-decoration: underline dotted;
60 | text-decoration: underline dotted;
61 | cursor: help;
62 | border-bottom: 0;
63 | -webkit-text-decoration-skip-ink: none;
64 | text-decoration-skip-ink: none;
65 | }
66 |
67 | address {
68 | margin-bottom: 1rem;
69 | font-style: normal;
70 | line-height: inherit;
71 | }
72 |
73 | ol,
74 | ul,
75 | dl {
76 | margin-top: 0;
77 | margin-bottom: 1rem;
78 | }
79 |
80 | ol ol,
81 | ul ul,
82 | ol ul,
83 | ul ol {
84 | margin-bottom: 0;
85 | }
86 |
87 | dt {
88 | font-weight: 700;
89 | }
90 |
91 | dd {
92 | margin-bottom: .5rem;
93 | margin-left: 0;
94 | }
95 |
96 | blockquote {
97 | margin: 0 0 1rem;
98 | }
99 |
100 | b,
101 | strong {
102 | font-weight: bolder;
103 | }
104 |
105 | small {
106 | font-size: 80%;
107 | }
108 |
109 | sub,
110 | sup {
111 | position: relative;
112 | font-size: 75%;
113 | line-height: 0;
114 | vertical-align: baseline;
115 | }
116 |
117 | sub {
118 | bottom: -.25em;
119 | }
120 |
121 | sup {
122 | top: -.5em;
123 | }
124 |
125 | a {
126 | color: #007bff;
127 | text-decoration: none;
128 | background-color: transparent;
129 | }
130 |
131 | a:hover {
132 | color: #0056b3;
133 | text-decoration: underline;
134 | }
135 |
136 | a:not([href]) {
137 | color: inherit;
138 | text-decoration: none;
139 | }
140 |
141 | a:not([href]):hover {
142 | color: inherit;
143 | text-decoration: none;
144 | }
145 |
146 | pre,
147 | code,
148 | kbd,
149 | samp {
150 | font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
151 | font-size: 1em;
152 | }
153 |
154 | pre {
155 | margin-top: 0;
156 | margin-bottom: 1rem;
157 | overflow: auto;
158 | }
159 |
160 | figure {
161 | margin: 0 0 1rem;
162 | }
163 |
164 | img {
165 | vertical-align: middle;
166 | border-style: none;
167 | }
168 |
169 | svg {
170 | overflow: hidden;
171 | vertical-align: middle;
172 | }
173 |
174 | table {
175 | border-collapse: collapse;
176 | }
177 |
178 | caption {
179 | padding-top: 0.75rem;
180 | padding-bottom: 0.75rem;
181 | color: #6c757d;
182 | text-align: left;
183 | caption-side: bottom;
184 | }
185 |
186 | th {
187 | text-align: inherit;
188 | }
189 |
190 | label {
191 | display: inline-block;
192 | margin-bottom: 0.5rem;
193 | }
194 |
195 | button {
196 | border-radius: 0;
197 | }
198 |
199 | button:focus {
200 | outline: 1px dotted;
201 | outline: 5px auto -webkit-focus-ring-color;
202 | }
203 |
204 | input,
205 | button,
206 | select,
207 | optgroup,
208 | textarea {
209 | margin: 0;
210 | font-family: inherit;
211 | font-size: inherit;
212 | line-height: inherit;
213 | }
214 |
215 | button,
216 | input {
217 | overflow: visible;
218 | }
219 |
220 | button,
221 | select {
222 | text-transform: none;
223 | }
224 |
225 | select {
226 | word-wrap: normal;
227 | }
228 |
229 | button,
230 | [type="button"],
231 | [type="reset"],
232 | [type="submit"] {
233 | -webkit-appearance: button;
234 | }
235 |
236 | button:not(:disabled),
237 | [type="button"]:not(:disabled),
238 | [type="reset"]:not(:disabled),
239 | [type="submit"]:not(:disabled) {
240 | cursor: pointer;
241 | }
242 |
243 | button::-moz-focus-inner,
244 | [type="button"]::-moz-focus-inner,
245 | [type="reset"]::-moz-focus-inner,
246 | [type="submit"]::-moz-focus-inner {
247 | padding: 0;
248 | border-style: none;
249 | }
250 |
251 | input[type="radio"],
252 | input[type="checkbox"] {
253 | box-sizing: border-box;
254 | padding: 0;
255 | }
256 |
257 | input[type="date"],
258 | input[type="time"],
259 | input[type="datetime-local"],
260 | input[type="month"] {
261 | -webkit-appearance: listbox;
262 | }
263 |
264 | textarea {
265 | overflow: auto;
266 | resize: vertical;
267 | }
268 |
269 | fieldset {
270 | min-width: 0;
271 | padding: 0;
272 | margin: 0;
273 | border: 0;
274 | }
275 |
276 | legend {
277 | display: block;
278 | width: 100%;
279 | max-width: 100%;
280 | padding: 0;
281 | margin-bottom: .5rem;
282 | font-size: 1.5rem;
283 | line-height: inherit;
284 | color: inherit;
285 | white-space: normal;
286 | }
287 |
288 | progress {
289 | vertical-align: baseline;
290 | }
291 |
292 | [type="number"]::-webkit-inner-spin-button,
293 | [type="number"]::-webkit-outer-spin-button {
294 | height: auto;
295 | }
296 |
297 | [type="search"] {
298 | outline-offset: -2px;
299 | -webkit-appearance: none;
300 | }
301 |
302 | [type="search"]::-webkit-search-decoration {
303 | -webkit-appearance: none;
304 | }
305 |
306 | ::-webkit-file-upload-button {
307 | font: inherit;
308 | -webkit-appearance: button;
309 | }
310 |
311 | output {
312 | display: inline-block;
313 | }
314 |
315 | summary {
316 | display: list-item;
317 | cursor: pointer;
318 | }
319 |
320 | template {
321 | display: none;
322 | }
323 |
324 | [hidden] {
325 | display: none !important;
326 | }
327 | /*# sourceMappingURL=bootstrap-reboot.css.map */
--------------------------------------------------------------------------------
/system/bootstrap4/css/bootstrap-reboot.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v4.4.1 (https://getbootstrap.com/)
3 | * Copyright 2011-2019 The Bootstrap Authors
4 | * Copyright 2011-2019 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */
--------------------------------------------------------------------------------
/system/bootstrap4/version.txt:
--------------------------------------------------------------------------------
1 | 4.4.1
2 |
--------------------------------------------------------------------------------
/system/general.js:
--------------------------------------------------------------------------------
1 | // GENERAL.JS http://www.mat-o-wahl.de
2 | // General functions / Allgemeine Verarbeitungen
3 | // License: GPL 3
4 | // Mathias Steudtner http://www.medienvilla.com
5 |
6 | var version = "0.6.0.12.20250425"
7 |
8 | // Globale Variablen
9 | var arQuestionsShort = new Array(); // Kurzform der Fragen: Atomkraft, Flughafenausbau, ...
10 | var arQuestionsLong = new Array(); // Langform der Frage: Soll der Flughafen ausgebaut werden?
11 |
12 | var arPartyPositions = new Array(); // Position der Partei als Zahl aus den CSV-Dateien (1/0/-1)
13 | var arPartyOpinions = new Array(); // Begründung der Parteien aus den CSV-Dateien
14 | var arPersonalPositions = new Array(); // eigene Position als Zahl (1/0/-1)
15 | var arVotingDouble = new Array(); // eigene Position als Zahl (2/1/0/-1/-2)
16 |
17 | // var arPartyFiles = new Array(); // Liste mit den Dateinamen der Parteipositionen
18 | var arPartyNamesShort = new Array(); // Namen der Parteien - kurz
19 | var arPartyNamesLong = new Array(); // Namen der Parteien - lang
20 | var arPartyDescription = new Array(); // Beschreibung der Datei
21 | var arPartyInternet = new Array(); // Internetseiten der Parteien
22 | var arPartyLogosImg = new Array(); // Logos der Parteien
23 |
24 | var arSortParties=new Array(); // Nummern der Listen, nach Punkten sortiert
25 |
26 | var activeQuestion=0; //aktuell angezeigte Frage (output.js)
27 | let intParties = 0;
28 |
29 | // Einlesen der CSV-Datei und Weitergabe an Rückgabefunktion "fnCallback"
30 | function fnReadCsv(csvFile,fnCallback)
31 | {
32 | // http://michaelsoriano.com/working-with-jquerys-ajax-promises-and-deferred-objects/
33 | $.ajax({
34 | type: "GET",
35 | url: csvFile,
36 | dataType: "text",
37 | contentType: "application/x-www-form-urlencoded",
38 | error: function(objXML, textStatus, errorThrown) {
39 | console.log("Mat-O-Wahl ERROR - Reading CSV-file \n Code - objXML-Status: "+objXML.status+" \n Code - textStatus: "+textStatus+" \n Code - errorThrown: "+errorThrown+" \n Name and folder of CSV-file should be: "+csvFile+" \n\nPossible solutions: Check for capital letters? OR check the extension of the file (csv / xls / xlsx)? OR is the file in the wrong folder? OR are you working on a local machine :( instead of a server? See documentation on www.mat-o-wahl.de");
40 | // document.getElementById("descriptionAddonTop").innerHTML("nanu. Da ist etwas schief gegangen.")
41 | $("#descriptionExplanation").css("color","red").css("font-size", "150%")
42 | text = "
Nanu? Da ist etwas schief gegangen. Einige Dateien konnten nicht geladen werden. Sind Sie ein Besucher der Seite? Dann geben Sie bitte dem Administrator der Webseite Bescheid. Sind Sie der Administrator? Dann schauen Sie bitte in die Browser-Konsole (Strg+Umschalt+i) und/oder öffnen Sie die quicktest.html.
"
43 | text += "
Oh? Something went wrong. Some files couldn't be loaded. Are you a visitor of this site? Please inform the admin of the site. Are you the admin? Please check the browser-console (Ctrl+Shift+i) and/or open quicktest.html.
"
44 | $("#descriptionExplanation").html(text)
45 | }
46 | })
47 | .done(function(data) {
48 | // console.log('success', data)
49 | console.log("Mat-o-Wahl load: "+csvFile);
50 | fnCallback(data);
51 | })
52 | .fail(function(xhr) {
53 | console.log('Mat-O-Wahl file error - ', xhr);
54 | });
55 | }
56 |
57 | // Zahl der Parteien dynamisch berechnen, anstatt sie in der definition.js anzugeben
58 | function fnSetIntParties(data) {
59 | let arIntParties = data.split("\n");
60 | // Falls die fileAnswers (und damit der Array) mit leeren Zeilen endet, diese entfernen
61 | while (true) {
62 | if (arIntParties[arIntParties.length - 1] === "" || arIntParties[arIntParties.length - 1] === "\r") {
63 | arIntParties.pop();
64 | }
65 | else break;
66 | }
67 | // Globale Variable erstellen, um Problem mit return values in async ajax calls zu umgehen
68 | // Ergebnis runden, um Fehlertoleranz zu erhöhen
69 | return Math.round(arIntParties.length / (intQuestions + 6));
70 | }
71 |
72 | // Anzeige der Fragen (aus fnStart())
73 | function fnShowQuestions(csvData)
74 | {
75 | // Einlesen der Fragen ...
76 | // fnSplitLines(csvData,1);
77 | fnTransformCsvToArray(csvData,1)
78 |
79 | // ... und Anzeigen
80 | var questionNumber = -1;
81 |
82 | // v.0.6 - deaktiviert, da nun am Anfang ein Willkommensbildschirm erscheint.
83 | // neu: fnHideWelcomeMessage()
84 | // fnShowQuestionNumber(questionNumber);
85 | }
86 |
87 |
88 |
89 | // Einlesen der Parteipositionen und Partei-Informationen (aus fnStart())
90 | function fnReadPositions(csvData)
91 | {
92 | // Einlesen der Parteipositionen und Vergleichen
93 | // fnSplitLines(csvData,0);
94 | intParties = fnSetIntParties(csvData)
95 | fnTransformCsvToArray(csvData,0)
96 | }
97 |
98 |
99 | // Auswertung (Berechnung)
100 | // Gibt ein Array "arResults" zurück für fnEvaluationShort(), fnEvaluationByThesis(), fnEvaluationByParty() und fnReEvaluate();
101 | // Aufruf am Ende aller Fragen in fnShowQuestionNumber() und beim Prüfen auf die "doppelte Wertung" in fnReEvaluate()
102 | function fnEvaluation()
103 | {
104 |
105 | // Abstimmungsknöpfe u.a. entfernen
106 | $("#sectionDescription").empty().hide();
107 | $("#sectionShowQuestions").empty().hide();
108 | $("#sectionVotingButtons").empty().hide();
109 | $("#sectionNavigation").empty().hide();
110 |
111 | $("#keepStats").hide();
112 |
113 | // Anzahl der Fragen bestimmen, da Positions-Array ein Vielfaches aus Fragen * Parteien enthält.
114 | // var numberOfQuestions = arQuestionsLong.length; // 3 Fragen
115 | // var numberOfPositions = arPartyPositions.length; // 12 = 3 Fragen * 4 Parteien
116 |
117 | var numberOfQuestions = intQuestions; // 3 Fragen
118 | var numberOfPositions = intQuestions * intParties; // 12 = 3 Fragen * 4 Parteien
119 |
120 | var indexPartyInArray = -1; // Berechnung der Position des Index der aktuellen Partei
121 | var positionsMatch = 0; // Zaehler fuer gemeinsame Positionen
122 |
123 | // var arResults = new Array();
124 | var arResults = []
125 | // for (i = 0; i <= (arPartyFiles.length-1); i++)
126 | for (i = 0; i <= (intParties-1); i++)
127 | {
128 | arResults.push(0); // Array mit leeren Werten füllen
129 | }
130 |
131 | // Vergleichen der Positionen (= Fragen x Parteien)
132 | for (i = 0; i <= (numberOfPositions-1); i++)
133 | {
134 | var modulo = i % numberOfQuestions; // 0=0,3,6,9 ; 1=1,4,7,10 ; 2=2,5,8,11
135 | if (modulo == 0)
136 | {
137 | indexPartyInArray++; // neue Partei in der Array-Liste
138 | positionsMatch = 0;
139 | }
140 |
141 | // Frage wurde nicht uebersprungen per SKIP (99) oder GEHE ZUR NAECHSTEN FRAGE (-)
142 | if ( (arPersonalPositions[modulo] < 99) )
143 | {
144 | var faktor=1; // Faktor ist 1 normal und 2, wenn Frage doppelt gewertet werden soll
145 | if(arVotingDouble[modulo])
146 | {faktor=2;}
147 |
148 | // Bei Uebereinstimmung der persönlichen Meinung (1,0,-1) mit Partei-Antwort (1,0-1), den Zaehler (Anzahl Übereinstimmungen) um eins erhoehen
149 | if (arPartyPositions[i] == arPersonalPositions[modulo])
150 | {
151 | positionsMatch+=faktor;
152 | arResults[indexPartyInArray] = positionsMatch;
153 |
154 | }
155 | // Eigene Meinung ist neutral ODER Partei ist neutral -> 0,5 Punkte vergeben
156 | else if ( (arPersonalPositions[modulo] == 0) || (arPartyPositions[i] == 0) )
157 | {
158 | positionsMatch+=0.5*faktor;
159 | arResults[indexPartyInArray] = positionsMatch;
160 |
161 | } // end: if arPartyPosition-i = arPersonalPosition
162 | } // end: Frage nicht uebersprungen
163 | } // end: for numberOfQuestions
164 |
165 |
166 | /*
167 | // Wenn Nutzer eingewilligt hat ...
168 | if ( $("#keepStatsCheckbox").prop("checked")==1)
169 | {
170 | // Sende Auswertung an Server
171 | fnSendResults(arResults, arPersonalPositions);
172 | }
173 | else
174 | {
175 | }
176 | */
177 |
178 | // $("#keepStats").hide().empty();
179 |
180 | // console.log(arResults)
181 | return arResults;
182 |
183 | }
184 |
185 |
186 | // Senden der persoenlichen Ergebnisse an den Server (nach Einwilligung)
187 | // Aufruf aus fnEvaluation()
188 | function fnSendResults(arResults, arPersonalPositions)
189 | {
190 | // Korrektur der Parteiposition (-1,0,1) mit den Informationen aus der doppelten Wertung (-2,-1,0,1,2)
191 | // Marius Nisslmueller, Bad Honnef, Juni 2020
192 | // Bedingung für übersprungene Frage hinzugefügt
193 | arPersonalPositionsForStats = arPersonalPositions.slice(); // Damit arPersonalPositions nicht verändert wird
194 | for(let i=0; i 4) && (modulo <= (intQuestions+4) ) )
288 | {
289 | // Positionen und Erklärungen
290 | arPartyPositions.push(valueOne); // -1,0,1
291 | arPartyOpinions.push(valueTwo); // Erklärung zur Zahl
292 | }
293 | else
294 | {
295 | // nothing to do. Just empty lines in the CSV-file
296 | }
297 | } // end: if-else modus == 1
298 | } // end: for
299 |
300 | } // end: function
301 |
302 | // v.0.3 NEU
303 | // ersetzt die Position (-1, 0, 1) mit dem passenden Button
304 | function fnTransformPositionToButton(position)
305 | {
306 | var arButtons = new Array("btn-danger","btn-warning","btn-success")
307 | var positionButton = "btn-default";
308 | for (z = -1; z <= 1; z++)
309 | {
310 | if (z == position)
311 | {
312 | positionButton = arButtons[(z+1)];
313 | }
314 | }
315 | return positionButton;
316 | }
317 |
318 | // v.0.3 NEU
319 | // ersetzt die Position (-1, 0, 1) mit dem passenden Icon
320 | function fnTransformPositionToIcon(position)
321 | {
322 | var arIcons = new Array("✖","◯","✔")
323 | var positionIcon = "↷";
324 | for (z = -1; z <= 1; z++)
325 | {
326 | if (z == position)
327 | {
328 | positionIcon = arIcons[(z+1)];
329 | }
330 | }
331 | return positionIcon;
332 | }
333 |
334 | // ersetzt die Partei-Position (-1, 0, 1) mit der passenden Farbe
335 | function fnTransformPositionToColor(position)
336 | {
337 | // red, yellow, green - "#ff0000","#ffff00","#00ff00"
338 | // Bootstrap-colors: https://github.com/twbs/bootstrap/blob/master/dist/css/bootstrap.css
339 | var arColors = new Array("#d9534f","#f0ad4e","#5cb85c")
340 | var positionColor = "#c0c0c0";
341 | for (z = -1; z <= 1; z++)
342 | {
343 | if (z == position)
344 | {
345 | positionColor = arColors[(z+1)];
346 | }
347 | }
348 | return positionColor;
349 |
350 | }
351 |
352 |
353 | // ersetzt die Partei-Position (-1, 0, 1) mit dem passenden Text
354 | function fnTransformPositionToText(position)
355 | {
356 | var arText = new Array("[-]","[o]","[+]")
357 | var positionText = "[/]";
358 | for (z = -1; z <= 1; z++)
359 | {
360 | if (z == position)
361 | {
362 | positionText = arText[(z+1)];
363 | }
364 | }
365 | return positionText;
366 |
367 | }
368 |
369 | // Gibt ein Bild/CSS-Klasse für den Balken in der Auswertung entsprechend der Prozentzahl Uebereinstimmung zurück
370 | function fnBarImage(percent)
371 | {
372 | // bis v.0.3 mit PNG-Bildern, danach mit farblicher Bootstrap-Progressbar
373 |
374 | if (percent <= 33) {
375 | // var barImage = "contra_px.png";
376 | var barImage = "bg-danger";
377 | }
378 | else if (percent <= 66) {
379 | // var barImage = "neutral_px.png";
380 | var barImage = "bg-warning";
381 | }
382 | else {
383 | // var barImage = "pro_px.png";
384 | var barImage = "bg-success";
385 | }
386 |
387 | return barImage;
388 | }
389 |
390 |
391 | // 02/2015 BenKob (doppelte Wertung)
392 | function fnToggleSelfPosition(i)
393 | {
394 | arPersonalPositions[i]--;
395 | if (arPersonalPositions[i]==-2)
396 | {arPersonalPositions[i]=99}
397 | if (arPersonalPositions[i]==98)
398 | {arPersonalPositions[i]=1}
399 | // var positionImage = fnTransformPositionToImage(arPersonalPositions[i]);
400 | var positionButton = fnTransformPositionToButton(arPersonalPositions[i]);
401 | var positionIcon = fnTransformPositionToIcon(arPersonalPositions[i]);
402 | // var positionColor = fnTransformPositionToColor(arPersonalPositions[i]);
403 | var positionText = fnTransformPositionToText(arPersonalPositions[i]);
404 |
405 | // $("#selfPosition"+i).attr("src", "img/"+positionImage);
406 | $(".selfPosition"+i).removeClass("btn-danger btn-warning btn-success btn-default").addClass(positionButton);
407 | $(".selfPosition"+i).html(positionIcon);
408 | $(".selfPosition"+i).attr("alt", positionText);
409 | $(".selfPosition"+i).attr("title", positionText);
410 | // $(".positionRow"+i).css("border","1px solid "+positionColor);
411 |
412 | // console.log("toggle funktion i: "+i)
413 |
414 | fnReEvaluate();
415 | }
416 |
417 | // 02/2015 BenKob (doppelte Wertung)
418 | function fnToggleDouble(i)
419 | {
420 | arVotingDouble[i]=!arVotingDouble[i];
421 | if(arVotingDouble[i])
422 | {
423 | // $("#doubleIcon"+i).attr("src","img/double-yes_icon.png");
424 | $("#doubleIcon"+i).removeClass("btn-outline-dark").addClass("btn-dark");
425 | $("#doubleIcon"+i).attr("title",TEXT_ANSWER_DOUBLE);
426 | }
427 | else
428 | {
429 | // $("#doubleIcon"+i).attr("src","img/double-no_icon.png");
430 | $("#doubleIcon"+i).removeClass("btn-dark").addClass("btn-outline-dark");
431 | $("#doubleIcon"+i).attr("title",TEXT_ANSWER_NORMAL);
432 | }
433 | fnReEvaluate();
434 | }
435 |
436 |
437 |
438 | // vanilla JavaScript FadeIn / FadeOut
439 | // Modus = display: "none / block" ändern (0 = nein, 1 = ja)
440 | function fnFadeIn(el, time, modus) {
441 |
442 | // Default FadeIn / FadeOut-Time
443 | if (!time) {time = 500;}
444 |
445 | // Loading CSS
446 | el.style.animation = "myFadeIn "+time+"ms 1"
447 | el.style.opacity = 1;
448 |
449 | if (modus == 1) {
450 | el.style.display = ""
451 | el.style.visibility = ""
452 | }
453 | }
454 |
455 | // vanilla JavaScript FadeIn / FadeOut
456 | // Modus = visibility show / hidden ändern (0 = nein, 1 = ja)
457 | function fnFadeOut(el, time, modus) {
458 |
459 | // Default FadeIn / FadeOut-Time
460 | if (!time) {time = 500;}
461 |
462 | // Loading CSS
463 | el.style.animation = "myFadeOut "+time+"ms 1"
464 | el.style.opacity = 0;
465 |
466 | // hide element from DOM AFTER opacity is set to 0 (setTimeout)
467 | if (modus == 1) {
468 | window.setTimeout(function() {
469 | el.style.display = "none"
470 | el.style.visibility = "hidden"
471 | }, (time-50));
472 | }
473 | }
474 |
--------------------------------------------------------------------------------
/system/imprint.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Mat-O-Wahl - Impressum / Legal Notice
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
141 | Der Mat-O-Wahl ist ein freies Programm zum Vergleichen von Parteipositionen mit der eigenen Meinung.
142 |
143 |
144 |
145 | Der Mat-O-Wahl arbeitet nach dem Vorbild des "Wahl-O-Mat". Dieser wird in Deutschland von der "Bundeszentrale für politische Bildung" (bpb) herausgegeben.
146 |
147 |
148 |
149 |
150 | Mat-O-Wahl is a free software to compare party positions with your own opinion.
151 |
152 |
153 |
154 | Mat-O-Wahl is based on the "Wahl-O-Mat" - the German version of the "StemWizer" (The Netherlands), "Electoral Compass" (USA) or "Smartvote" (Switzerland).
155 |
156 |
157 |
158 |
159 |
160 |
Lizenz / License
161 |
162 |
163 |
164 |
165 | Der Mat-O-Wahl steht unter der GPL - GNU General Public License (Version 3) um eigene Änderungen und Anpassungen vornehmen zu können.
166 |
Umfangreichere Auswertungen sind mit ihrer Lieblings-Tabellenkalkulation möglich. (Excel, Open-/LibreOffice Calc, ...) Siehe auch die Beispieldatei im Ordner.
");
38 |
39 | // Datei mit den ERGEBNISSEN in Array einlesen
40 | // Im Beispiel der VOTE.PHP heißt sie TEST.TXT
41 | fnReadCsv(fileResults,fnResultsResultsfileToArray);
42 |
43 |
44 | // NAMEN DER PARTEIEN in Array einlesen
45 | // arPartyNamesShort = fnTransformDefinitionStringToArray(strPartyNamesShort);
46 |
47 | // LOGOS der Parteien in Array einlesen
48 | // arPartyLogosImg = fnTransformDefinitionStringToArray(strPartyLogosImg);
49 | }
50 |
51 |
52 | function fnResultsQuestionsToArray(csvData)
53 | {
54 | arQuestionsShort = $.csv.toArrays(csvData, {separator: ""+separator+""}); // <- Trennzeichen fuer Fragen wird aus der DEFINITION.JS gelesen und benutzt
55 |
56 | // alert(arQuestionsShort[1][0]);
57 | }
58 |
59 | function fnResultsResultsfileToArray(csvData)
60 | {
61 | // Einlesen der Ergebnis-Datei
62 | var arResultfile = $.csv.toArrays(csvData, {separator: " "}); // <- im Beispiel (vote.php / test.txt) ist erstes Trennzeichen ein Leerzeichen. Es gibt also 4 Spalten (IP-Adresse, Zeitstempel, mowpersonal und mowparties)
63 |
64 | // Auftrennen der zweiten Spalte (arResultfile[i][1]) und als Array speichern
65 | for (i = 0; i <= arResultfile.length-1; i++)
66 | {
67 | temp = $.csv.toArray(arResultfile[i][1], {separator: ","});
68 | // arMowtimestamp.push(temp)
69 | temp = temp.toString().substr(0,10) // Datum abschneiden für alte DB-Abfragen: 2020-31-12-23-59 -> 2020-31-12
70 | arDatum.push(temp)
71 | }
72 |
73 |
74 | // Auftrennen der dritten Spalte (arResultfile[i][2]) und als Array speichern
75 | for (i = 0; i <= arResultfile.length-1; i++)
76 | {
77 | temp = $.csv.toArray(arResultfile[i][2], {separator: ","});
78 | arMowpersonal.push(temp)
79 | }
80 |
81 | // Auftrennen der vierten Spalte (arResultfile[i][3]) und als Array speichern
82 | var strTemp ;
83 | for (i = 0; i <= arResultfile.length-1; i++)
84 | {
85 | temp = $.csv.toArray(arResultfile[i][3], {separator: ","});
86 | arMowparties.push(temp)
87 | }
88 |
89 | fnResultsMowpersonal();
90 | fnResultsMowparties();
91 | fnResultsTimes();
92 |
93 | }
94 |
95 | ///////////////////////////////////////////////////////////////////////////
96 |
97 | // Abstimmung zu den Parteien
98 | function fnResultsMowparties()
99 | {
100 |
101 | var arResultsMowpartiesSum = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
102 | // var arResultsMowpartiesSum = []
103 |
104 | $("#resultsParties").empty();
105 |
106 | for (i = 0; i <= arMowparties.length-1; i++)
107 | {
108 |
109 | for (j = 0; j <= arPartyNamesShort.length-1; j++)
110 | {
111 | // Anzahl der Übereinstimmungen aufsummieren
112 | temp = 1*arMowparties[i][j] + 1*arResultsMowpartiesSum[j]
113 | arResultsMowpartiesSum[j] = temp;
114 |
115 | } // end for j-arPartyNamesShort
116 |
117 | } // end for i-questionsShort
118 |
119 | // PARTEI-AUSWERTUNG Nr. 1
120 | var maxPointsPerParty = arMowparties.length * arQuestionsShort.length;
121 | $("#resultsParties").append("
"+arMowparties.length+" Abstimmungen x "+intQuestions+" Fragen = maximal "+maxPointsPerParty+" Punkte pro Partei.
")
122 |
123 | content = "";
124 | content += "
";
125 | // for (i = 0; i <= arPartyNamesShort.length-1; i++)
126 | for (i = 0; i <= intParties-1; i++)
127 | {
128 | var percent = fnPercentage(arResultsMowpartiesSum[i],maxPointsPerParty);
129 |
130 | content += "
";
183 | $("#resultsParties").append(content)
184 |
185 | } // end function: fnResultsMowparties
186 |
187 | ///////////////////////////////////////////////////////////////////////////
188 |
189 | // Abstimmungen zu den einzelnen Fragen
190 | function fnResultsMowpersonal()
191 | {
192 |
193 | // for (i = 0; i <= arQuestionsShort.length-1; i++)
194 | for (i = 0; i <= intQuestions-1; i++)
195 | {
196 |
197 | // Zuruecksetzen der Zaehler
198 | var counterContra = 0;
199 | var counterNeutral = 0;
200 | var counterPro = 0;
201 | var counterSkip = 0;
202 |
203 | for (j = 0; j <= arMowpersonal.length-1; j++)
204 | {
205 | // Info:
206 | // arMowpersonal[i][j] = zeilenweises Lesen
207 | // arMowpersonal[j][i] = spaltenweises Lesen -> benoetigt fuer Summe
208 |
209 | if (arMowpersonal[j][i] == -1)
210 | { counterContra++ }
211 | else if (arMowpersonal[j][i] == 0)
212 | { counterNeutral++ }
213 | else if (arMowpersonal[j][i] == 1)
214 | { counterPro++ }
215 | else
216 | { counterSkip++ }
217 |
218 | } // end for intQuestions j
219 |
220 | // Abspeichern der gezaehlten Werte für diese Spalte / Frage
221 |
222 | arMowpersonalSumContra.push(counterContra)
223 | arMowpersonalSumNeutral.push(counterNeutral)
224 | arMowpersonalSumPro.push(counterPro)
225 | arMowpersonalSumSkip.push(counterSkip)
226 |
227 | } // end for arMowpersonal i
228 |
229 | var maxValues = arMowpersonal.length;
230 | var posQuestion = 0;
231 |
232 | // Array durchlaufen und anzeigen
233 | $("#resultsQuestions").empty();
234 |
235 | content = "";
236 | content += "
";
237 | // for (i = 0; i <= arQuestionsShort.length-1; i++)
238 | for (i = 0; i <= intQuestions-1; i++)
239 | {
240 | // immer vier Werte im Array pro Frage
241 |
242 | var percentContra = fnPercentage(arMowpersonalSumContra[i],maxValues);
243 | var percentNeutral = fnPercentage(arMowpersonalSumNeutral[i],maxValues);
244 | var percentPro = fnPercentage(arMowpersonalSumPro[i],maxValues);
245 | var percentSkip = fnPercentage(arMowpersonalSumSkip[i],maxValues);
246 |
247 | content += "