| 1 | /* |
| 2 | Copyright - 2017 2023 - wwwouaiebe - Contact: https://www.ouaie.be/ |
| 3 | |
| 4 | This program is free software; |
| 5 | you can redistribute it and/or modify it under the terms of the |
| 6 | GNU General Public License as published by the Free Software Foundation; |
| 7 | either version 3 of the License, or any later version. |
| 8 | |
| 9 | This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program; if not, write to the Free Software |
| 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | */ |
| 18 | /* |
| 19 | Changes: |
| 20 | - v4.0.0: |
| 21 | - created from v3.6.0 |
| 22 | Doc reviewed 202208 |
| 23 | */ |
| 24 | |
| 25 | import theHTMLElementsFactory from '../../core/uiLib/HTMLElementsFactory.js'; |
| 26 | import theTranslator from '../../core/uiLib/Translator.js'; |
| 27 | import NonModalBaseDialog from '../baseDialog/NonModalBaseDialog.js'; |
| 28 | import theHTMLSanitizer from '../../core/htmlSanitizer/HTMLSanitizer.js'; |
| 29 | import { theAppVersion } from '../../data/Version.js'; |
| 30 | |
| 31 | /* ------------------------------------------------------------------------------------------------------------------------- */ |
| 32 | /** |
| 33 | This class is the 'About' dialog |
| 34 | */ |
| 35 | /* ------------------------------------------------------------------------------------------------------------------------- */ |
| 36 | |
| 37 | class AboutDialog extends NonModalBaseDialog { |
| 38 | |
| 39 | /** |
| 40 | The main |
| 41 | @type {HTMLElement} |
| 42 | */ |
| 43 | |
| 44 | #aboutHTMLElement = null; |
| 45 | |
| 46 | /** |
| 47 | The constructor |
| 48 | */ |
| 49 | |
| 50 | constructor ( ) { |
| 51 | super ( ); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | Create all the controls needed for the dialog. |
| 56 | Overload of the base class createContentHTML |
| 57 | */ |
| 58 | |
| 59 | createContentHTML ( ) { |
| 60 | this.#aboutHTMLElement = theHTMLElementsFactory.create ( 'div', { id : 'TravelNotes-AboutDialog-About' } ); |
| 61 | theHTMLSanitizer.sanitizeToHtmlElement ( |
| 62 | '<p>This program is free software; you can redistribute it and/or modify it under the terms of the ' + |
| 63 | 'GNU General Public License as published by the Free Software Foundation; either version 3 of the License, ' + |
| 64 | 'or any later version.</p>' + |
| 65 | '<p>Copyright - 2017 2023 - wwwouaiebe</p>' + |
| 66 | '<p>Contact : <a href="https://www.ouaie.be/pages/Contact" target="_blank">https://www.ouaie.be/</a></p>' + |
| 67 | '<p>GitHub : <a href="https://github.com/wwwouaiebe/TravelNotes" target="_blank">' + |
| 68 | 'https://github.com/wwwouaiebe/TravelNotes</a></p>' + |
| 69 | '<p>Version : ' + theAppVersion + '.' + |
| 70 | '<p>This program uses:' + |
| 71 | ' <a href="https://leafletjs.com/" target="_blank">leaflet</a>,' + |
| 72 | ' <a href="https://github.com/Project-OSRM/osrm-text-instructions" target="_blank">' + |
| 73 | 'Project-OSRM/osrm-text-instructions</a> and ' + |
| 74 | ' <a href="https://github.com/drolbr/Overpass-API" target="_blank">the Overpass API</a></p>', |
| 75 | this.#aboutHTMLElement |
| 76 | ); |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | Overload of the base class show |
| 81 | */ |
| 82 | |
| 83 | show ( ) { |
| 84 | super.show ( ); |
| 85 | this.mover.centerDialog ( ); |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | Get an array with the HTMLElements that have to be added in the content of the dialog. |
| 90 | @type {Array.<HTMLElement>} |
| 91 | */ |
| 92 | |
| 93 | get contentHTMLElements ( ) { return [ this.#aboutHTMLElement ]; } |
| 94 | |
| 95 | /** |
| 96 | Return the dialog title. Overload of the BaseDialog.title property |
| 97 | @type {String} |
| 98 | */ |
| 99 | |
| 100 | get title ( ) { return theTranslator.getText ( 'AboutDialog - About Travel & Notes' ); } |
| 101 | |
| 102 | } |
| 103 | |
| 104 | export default AboutDialog; |
| 105 | |
| 106 | /* --- End of file --------------------------------------------------------------------------------------------------------- */ |
| 107 |