Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon Firmware Selector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon Firmware Selector
Commits
56d623d6
Unverified
Commit
56d623d6
authored
5 years ago
by
Julian Labus
Browse files
Options
Downloads
Patches
Plain Diff
add a checkbox to displays not recommended devices
parent
52833142
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
app.css
+20
-4
20 additions, 4 deletions
app.css
app.js
+47
-12
47 additions, 12 deletions
app.js
config_template.js
+6
-0
6 additions, 0 deletions
config_template.js
index.html
+19
-0
19 additions, 0 deletions
index.html
with
92 additions
and
16 deletions
app.css
+
20
−
4
View file @
56d623d6
...
@@ -110,16 +110,30 @@ h1, h2, h3, h4, h5, h6 {
...
@@ -110,16 +110,30 @@ h1, h2, h3, h4, h5, h6 {
color
:
#dc0067
;
color
:
#dc0067
;
}
}
.firmwareTableLink
{
.firmwareTableLink
,
.notRecommendedLink
,
.InfoLink
{
clear
:
right
;
float
:
right
;
float
:
right
;
color
:
#337ab7
;
color
:
#337ab7
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.firmwareTableLink
:hover
{
.notRecommendedLink
{
display
:
none
;
}
.firmwareTableLink
:hover
,
.notRecommendedLink
:hover
{
text-decoration
:
underline
;
text-decoration
:
underline
;
}
}
.notRecommendedLabel
{
color
:
#337ab7
;
}
#wizard
#model-pane
.notRecommendedCheckbox
{
width
:
auto
;
display
:
inline
;
}
#wizard
.pane-wrapper
{
#wizard
.pane-wrapper
{
box-shadow
:
0
0.15em
0.5em
#ccc
;
box-shadow
:
0
0.15em
0.5em
#ccc
;
margin
:
1em
0
3em
0
;
margin
:
1em
0
3em
0
;
...
@@ -180,7 +194,8 @@ h1, h2, h3, h4, h5, h6 {
...
@@ -180,7 +194,8 @@ h1, h2, h3, h4, h5, h6 {
box-shadow
:
0
0
0.5em
#005ea0
inset
;
box-shadow
:
0
0
0.5em
#005ea0
inset
;
}
}
#wizard
#branch-pane
.warning-experimental
{
#wizard
#branch-pane
.warning-experimental
,
#wizard
#model-pane
.warning-notrecommended
{
display
:
none
;
display
:
none
;
margin
:
1em
0
;
margin
:
1em
0
;
padding
:
1em
;
padding
:
1em
;
...
@@ -188,7 +203,8 @@ h1, h2, h3, h4, h5, h6 {
...
@@ -188,7 +203,8 @@ h1, h2, h3, h4, h5, h6 {
border
:
.5em
solid
#009ee0
;
border
:
.5em
solid
#009ee0
;
}
}
#wizard
#branch-pane
.show-experimental-warning
.warning-experimental
{
#wizard
#branch-pane
.show-experimental-warning
.warning-experimental
,
#wizard
#model-pane
.show-notrecommended-warning
.warning-notrecommended
{
display
:
block
;
display
:
block
;
}
}
...
...
This diff is collapsed.
Click to expand it.
app.js
+
47
−
12
View file @
56d623d6
...
@@ -104,7 +104,8 @@ var firmwarewizard = function() {
...
@@ -104,7 +104,8 @@ var firmwarewizard = function() {
var
wizard
=
parseWizardObject
();
var
wizard
=
parseWizardObject
();
app
.
currentVersions
=
{};
app
.
currentVersions
=
{};
var
images
=
{};
var
availableImages
=
{};
var
images
=
availableImages
;
var
vendormodels_reverse
;
var
vendormodels_reverse
;
var
typeNames
=
{
var
typeNames
=
{
...
@@ -145,6 +146,14 @@ var firmwarewizard = function() {
...
@@ -145,6 +146,14 @@ var firmwarewizard = function() {
if
(
"
enabled_device_categories
"
in
config
)
{
if
(
"
enabled_device_categories
"
in
config
)
{
enabled_device_categories
=
config
.
enabled_device_categories
;
enabled_device_categories
=
config
.
enabled_device_categories
;
}
}
if
(
config
.
recommended_toggle
)
{
enabled_device_categories
=
[
'
recommended
'
];
show_inline
(
'
.notRecommendedLink
'
);
if
(
config
.
recommended_info_link
)
{
$
(
'
#notrecommendedinfo
'
).
innerHTML
=
'
<p><a href="
'
+
config
.
recommended_info_link
+
'
" target="_new">Mehr Informationen</a>
'
;
}
}
function
buildVendorModelsReverse
()
{
function
buildVendorModelsReverse
()
{
var
vendormodels_reverse
=
{};
var
vendormodels_reverse
=
{};
...
@@ -188,6 +197,21 @@ var firmwarewizard = function() {
...
@@ -188,6 +197,21 @@ var firmwarewizard = function() {
return
wizard
;
return
wizard
;
}
}
function
setFilteredImages
()
{
images
=
{};
for
(
var
vendor
in
availableImages
)
{
images
[
vendor
]
=
{};
for
(
var
model
in
availableImages
[
vendor
])
{
for
(
var
device
in
availableImages
[
vendor
][
model
])
{
console
.
log
(
availableImages
[
vendor
][
model
][
device
].
category
)
if
(
enabled_device_categories
.
indexOf
(
availableImages
[
vendor
][
model
][
device
].
category
)
>
-
1
)
{
addArray
(
images
[
vendor
],
model
,
availableImages
[
vendor
][
model
][
device
]);
}
}
}
}
}
window
.
onpopstate
=
function
(
event
)
{
window
.
onpopstate
=
function
(
event
)
{
if
(
event
.
state
===
null
)
return
;
if
(
event
.
state
===
null
)
return
;
wizard
=
parseWizardObject
(
event
.
state
);
wizard
=
parseWizardObject
(
event
.
state
);
...
@@ -231,6 +255,10 @@ var firmwarewizard = function() {
...
@@ -231,6 +255,10 @@ var firmwarewizard = function() {
scrollDown
();
scrollDown
();
});
});
$
(
'
#wizard .notRecommendedLink
'
).
addEventListener
(
'
click
'
,
function
(
e
)
{
toggleClass
(
$
(
'
#model-pane
'
),
'
show-notrecommended-warning
'
);
});
$
(
'
#wizard .firmwareTableLink
'
).
addEventListener
(
'
click
'
,
function
(
e
)
{
$
(
'
#wizard .firmwareTableLink
'
).
addEventListener
(
'
click
'
,
function
(
e
)
{
firmwarewizard
.
showFirmwareTable
();
firmwarewizard
.
showFirmwareTable
();
});
});
...
@@ -239,6 +267,17 @@ var firmwarewizard = function() {
...
@@ -239,6 +267,17 @@ var firmwarewizard = function() {
firmwarewizard
.
hideFirmwareTable
();
firmwarewizard
.
hideFirmwareTable
();
});
});
$
(
'
#notrecommendedselect
'
).
addEventListener
(
'
change
'
,
function
(
e
)
{
if
(
this
.
checked
)
{
enabled_device_categories
=
config
.
enabled_device_categories
;
}
else
if
(
"
enabled_device_categories
"
in
config
)
{
enabled_device_categories
=
[
'
recommended
'
];
}
setFilteredImages
();
updateHTML
(
wizard
);
updateFirmwareTable
();
});
vendormodels_reverse
=
buildVendorModelsReverse
();
vendormodels_reverse
=
buildVendorModelsReverse
();
loadDirectories
(
function
()
{
loadDirectories
(
function
()
{
...
@@ -251,7 +290,7 @@ var firmwarewizard = function() {
...
@@ -251,7 +290,7 @@ var firmwarewizard = function() {
var
model
=
fullModelList
[
m
][
MODEL_MODEL
];
var
model
=
fullModelList
[
m
][
MODEL_MODEL
];
previews
.
appendChild
(
createPicturePreview
(
vendor
,
model
,
searchstring
));
previews
.
appendChild
(
createPicturePreview
(
vendor
,
model
,
searchstring
));
}
}
setFilteredImages
();
updateHTML
(
wizard
);
updateHTML
(
wizard
);
show_block
(
'
.manualSelection
'
);
show_block
(
'
.manualSelection
'
);
updateFirmwareTable
();
updateFirmwareTable
();
...
@@ -370,11 +409,6 @@ var firmwarewizard = function() {
...
@@ -370,11 +409,6 @@ var firmwarewizard = function() {
return
;
return
;
}
}
if
(
enabled_device_categories
.
indexOf
(
device
.
category
)
==
-
1
)
{
// the category is not in the list of enabled categories
return
;
}
var
strippedFilename
=
filename
;
var
strippedFilename
=
filename
;
strippedFilename
=
strippedFilename
.
replace
(
config
.
community_prefix
,
'
-
'
);
strippedFilename
=
strippedFilename
.
replace
(
config
.
community_prefix
,
'
-
'
);
...
@@ -450,18 +484,19 @@ var firmwarewizard = function() {
...
@@ -450,18 +484,19 @@ var firmwarewizard = function() {
// collect branch versions
// collect branch versions
app
.
currentVersions
[
branch
]
=
version
;
app
.
currentVersions
[
branch
]
=
version
;
if
(
!
(
device
.
vendor
in
i
mages
))
{
if
(
!
(
device
.
vendor
in
availableI
mages
))
{
i
mages
[
device
.
vendor
]
=
{};
availableI
mages
[
device
.
vendor
]
=
{};
}
}
addArray
(
i
mages
[
device
.
vendor
],
device
.
model
,
{
addArray
(
availableI
mages
[
device
.
vendor
],
device
.
model
,
{
'
revision
'
:
revision
,
'
revision
'
:
revision
,
'
branch
'
:
branch
,
'
branch
'
:
branch
,
'
type
'
:
type
,
'
type
'
:
type
,
'
version
'
:
version
,
'
version
'
:
version
,
'
location
'
:
location
,
'
location
'
:
location
,
'
size
'
:
size
,
'
size
'
:
size
,
'
preview
'
:
preview
+
"
.jpg
"
'
preview
'
:
preview
+
"
.jpg
"
,
'
category
'
:
device
.
category
});
});
}
}
...
@@ -674,7 +709,7 @@ var firmwarewizard = function() {
...
@@ -674,7 +709,7 @@ var firmwarewizard = function() {
var
model
=
modelList
[
f
][
MODEL_MODEL
];
var
model
=
modelList
[
f
][
MODEL_MODEL
];
for
(
p
=
0
;
p
<
previews
.
length
;
p
++
)
{
for
(
p
=
0
;
p
<
previews
.
length
;
p
++
)
{
if
(
previews
[
p
].
getAttribute
(
'
data-
searchstring
'
)
==
searchstring
)
{
if
(
previews
[
p
].
getAttribute
(
'
data-
model
'
)
==
model
)
{
previews
[
p
].
style
.
display
=
'
inline-block
'
;
previews
[
p
].
style
.
display
=
'
inline-block
'
;
if
(
modelList
.
length
==
1
)
{
if
(
modelList
.
length
==
1
)
{
setClass
(
previews
[
p
],
'
selected
'
,
true
);
setClass
(
previews
[
p
],
'
selected
'
,
true
);
...
...
This diff is collapsed.
Click to expand it.
config_template.js
+
6
−
0
View file @
56d623d6
...
@@ -20,6 +20,12 @@ var config = {
...
@@ -20,6 +20,12 @@ var config = {
vendormodels
:
vendormodels
,
vendormodels
:
vendormodels
,
// set enabled categories of devices (see devices.js)
// set enabled categories of devices (see devices.js)
enabled_device_categories
:
[
"
recommended
"
],
enabled_device_categories
:
[
"
recommended
"
],
// Display a checkbox that allows to display not recommended devices.
// This only make sense if enabled_device_categories also contains not
// recommended devices.
recommended_toggle
:
false
,
// Optional link to an info page about no longer recommended devices
recommended_info_link
:
null
,
// community prefix of the firmware images
// community prefix of the firmware images
community_prefix
:
'
gluon-ffda-
'
,
community_prefix
:
'
gluon-ffda-
'
,
// firmware version regex
// firmware version regex
...
...
This diff is collapsed.
Click to expand it.
index.html
+
19
−
0
View file @
56d623d6
...
@@ -18,8 +18,27 @@
...
@@ -18,8 +18,27 @@
<img
src=
"./router.png"
>
<img
src=
"./router.png"
>
<div
class=
"pane-wrapper"
>
<div
class=
"pane-wrapper"
>
<div
id=
"model-pane"
class=
"pane"
>
<div
id=
"model-pane"
class=
"pane"
>
<span
class=
"notRecommendedLink"
>
Nicht empfohlene Geräte anzeigen
</span>
<span
class=
"firmwareTableLink"
>
Tabelle anzeigen
</span>
<span
class=
"firmwareTableLink"
>
Tabelle anzeigen
</span>
<h1>
Schritt 1: Wähle Dein Routermodell
</h1>
<h1>
Schritt 1: Wähle Dein Routermodell
</h1>
<div
class=
"warning-notrecommended"
>
<p>
<b>
Vorsicht!
</b>
Nicht ohne Grund siehst Du in der Voreinstellung
nur die empfohlenen Geräte. Diese sind gut getestet und haben
ausreichend Leistung um Dir und den Freifunk Benutzer auf absehbare
Zeit Spaß machen.
</p>
<p>
Wir wollen niemanden zwingen ausschließlich diese Geräte zu
verwenden, bitten Dich aber, dass Du Dich vorab gründlich
informierst, bevor Du nicht empfohlene Geräte verwendest,
damit Du selbst abwägen kannst, ob Du wirklich die Nachteile in
Kauf nehmen willst.
</p>
<div
id=
"notrecommendedinfo"
></div>
<input
type=
"checkbox"
id=
"notrecommendedselect"
class=
"notRecommendedCheckbox"
value=
"notRecommended"
/>
<label
class=
"notRecommendedLabel"
for=
"notrecommendedselect"
>
Nicht empfohlene Geräte trotzdem anzeigen
</label>
</div>
<p>
Erst mit der Freifunk-Firmware wird dein Router zu einem Teil des
<p>
Erst mit der Freifunk-Firmware wird dein Router zu einem Teil des
Freifunk-Netzes. Sie ist fertig vorkonfiguriert, um Kontakt mit
Freifunk-Netzes. Sie ist fertig vorkonfiguriert, um Kontakt mit
benachbarten Freifunk-Knoten aufzunehmen, ein offenes und ohne
benachbarten Freifunk-Knoten aufzunehmen, ein offenes und ohne
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment