summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorruben <ruben.git@r.z11.de>2015-04-26 00:33:34 +0200
committerruben <ruben.git@r.z11.de>2015-04-26 00:33:34 +0200
commitfb9609bd3390aa65dd2dbf5ecab4ca7ad60ea0bd (patch)
treed1bf88cdf4e0f1cd9a457f1f4e957be1ef7f1b93
parent687de01b51784a7ea9839e5eaee5194ed945b52a (diff)
Selectbox for manufacturer
-rw-r--r--assets/javascripts/main.js47
-rw-r--r--index.html15
2 files changed, 60 insertions, 2 deletions
diff --git a/assets/javascripts/main.js b/assets/javascripts/main.js
index d97177a..73f8dcf 100644
--- a/assets/javascripts/main.js
+++ b/assets/javascripts/main.js
@@ -1,6 +1,51 @@
$(document).ready(function() {
+ $('#manufacturer').on('change', function() {
+ selected=this.value;
+ first=[];
+ $("#manufacturer option").each(function() {
+ o=$(this).val();
+ if(o != '-1'){
+ if(o != selected && selected != '-1'){
+ $("#download-form-router option[value^='" + o + "-']").hide();
+ } else {
+ $("#download-form-router option[value^='" + o + "-']").show();
+ }
+ }
+ });
+ if(selected == 'tp-link'){
+ defaultSel=selected + "-tl-wr841n-nd-v9";
+ $("#download-form-router").val(defaultSel);
+ } else {
+ $("#download-form-router").val('-1');
+ }
+ $("#download-form-router").focus();
+ $("#download-form-router").select();
+ });
+
+ $('#branch').on('change', function() {
+ updateButton()
+ });
+
+ $('#download-form-type').on('change', function() {
+ updateButton()
+ });
+
+ function updateButton(){
+ if($('#branch').val() == "1"){
+ button_html="Experimental";
+ } else {
+ button_html="Stable"
+ }
+
+ if($('#download-form-type').val() == "0"){
+ button_html+=" Neuinstallation";
+ } else {
+ button_html+=" Update";
+ }
+ $("#download-button").html(button_html + " Herunterladen");
+ }
- $('#download-form').submit(function( event ) {
+ $('#download-form').submit(function( event ) {
event.preventDefault();
var type = '',
diff --git a/index.html b/index.html
index 220a160..ae2ecf1 100644
--- a/index.html
+++ b/index.html
@@ -26,10 +26,23 @@
<option value="0">Neuinstallation der Freifunk Firmware</option>
<option value="1">Update der Freifunk Firmware</option>
</select>
+
<select id="branch">
<option value="0">Stabile und getestete Version</option>
<option value="1">Experimentelle Version (für Profis)</option>
</select>
+
+ <select id="manufacturer">
+ <option value="-1">alle Hersteller anzeigen</option>
+ <option value="buffalo">Buffalo</option>
+ <option value="d-link">D-Link</option>
+ <option value="gl-inet">GL Inet</option>
+ <option value="linksys">Linksys</option>
+ <option value="netgear">NetGear</option>
+ <option value="tp-link">TP-Link</option>
+ <option value="ubiquiti">Ubiquiti</option>
+ </select>
+
<select id="download-form-router">
<option value="-1">Bitte wähle einen Router</option>
<optgroup label="Buffalo">
@@ -112,7 +125,7 @@
</optgroup>
</select>
- <button class="button">Herunterladen</button>
+ <button class="button" id="download-button">Herunterladen</button>
<a class="button" href="/firmware/ffki-images-0.6.zip">Alle Stable-Images als ZIP herunterladen</a>
</form>