diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..c321e7911555d4f27bf6642adb559eb56a654723 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +config.js +images/* diff --git a/README.md b/README.md index 9a019b768ec18b9d695a660ec1ceb347569f1bd9..b45abd0b7b642a68fc00cf5cb2be1a2a34bcb271 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,6 @@ OpenWrt/LEDE Firmware Wizard This Firmware Wizard lets a user select the correct firmware for his device. Directory listings are used to parse the list of available images. -This a fork of the [gluon-firmware-wizard](https://github.com/freifunk-darmstadt/gluon-firmware-wizard) containing these changes: -- jQuery and bootstrap.js were removed -- support for other images name formats -- simpler configuration -- no static branch names - Some [Screenshots](docs/screenshots.md). ### Configuration @@ -47,11 +41,10 @@ If no hardware revision is given or is it is empty, the revision is extracted fr If two matches overlap, the longest match will be assigned the matching files. On the other hand, the same match can be used by multiple models without problems. ### Configuration -Image paths and available branches can be set in file app.js. +Image paths and available branches can be set in file `config_template.js` which has to be renamed to `config.js` ### TODO - support rootfs/kernel image combinations -- server side site generation (maybe using python?) ### License This program is free software: you can redistribute it and/or modify diff --git a/app.js b/app.js index d8ddbce41fc7e6cac13d0b0d3d7ff2cb41570e32..1de673e92f8d9be32f650a091264856ed1fa406c 100644 --- a/app.js +++ b/app.js @@ -13,20 +13,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -var config = { - typeNames: { - 'factory': 'Erstinstallation', - 'sysupgrade': 'Upgrade' - }, - // relative image paths and branch - directories: { - // some demo sources - './images/gluon-factory.html': 'stable', - './images/gluon-sysupgrade.html': 'stable' - } -}; - function $(s) { return document.getElementById(s.substring(1)); } @@ -388,7 +374,11 @@ var firmwarewizard = function() { var types = getImageTypes(); for (var i in types) { var type = types[i]; - var displayType = config.typeNames[type] || type; + var typeNames = { + 'factory': 'Erstinstallation', + 'sysupgrade': 'Upgrade' + }; + var displayType = typeNames[type] || type; content += '<input type="radio" id="radiogroup-typeselect-' + type + '" ' + ((type == wizard.imageType) ? 'checked ' : '') + 'name="firmwareType" onclick="firmwarewizard.setImageType(\'' + type + '\');">' diff --git a/config_template.js b/config_template.js new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb3858df0f4b8da6f966c4e6d0036a5c809ec --- /dev/null +++ b/config_template.js @@ -0,0 +1,23 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +var config = { + // relative image paths and branch + directories: { + // some demo sources + './images/gluon-factory.html': 'stable', + './images/gluon-sysupgrade.html': 'stable' + } +}; diff --git a/index.html b/index.html index 4dad4d443a322d355b9c6c7a259f2428e5dbf9bc..e355e5102a9280b453b3d1684920519aae87923d 100644 --- a/index.html +++ b/index.html @@ -82,6 +82,7 @@ </div> <script src="devices.js"></script> + <script src="config.js"></script> <script src="app.js"></script> </body> </html>