Ignore:
Timestamp:
Aug 7, 2017, 6:02:05 PM (9 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
0.5, app-cordova, debian/bullseye, debian/jessie, master
Children:
27264f0
Parents:
0e71877
Message:

Improved GNUBoat webclient to be repsonsive

Location:
src/webapp/webclient
Files:
26 added
3 deleted
1 edited
4 moved

Legend:

Unmodified
Added
Removed
  • src/webapp/webclient/css/main.css

    r0e71877 r4972eea  
    1616*/
    1717
    18 body {
     18/*body {
    1919        margin: 1em;
    2020        width: 14em;
    2121        border-color: 1px solid black;
    22 }
     22}*/
    2323
    2424.backgroundblue {
    … …  
    3232}
    3333
    34 #title {
     34/*#title {
    3535        text-align: center;
    3636        font-size: 34pt;
    … …  
    4747        padding-left: 0em;
    4848        margin-left: -0.3em;
    49 }
     49}*/
    5050
    5151#display {
    … …  
    116116}
    117117
    118 form {
    119         width: 58.3mm;
    120 }
    121 
    122 form h2 {
    123         text-align: center;
    124         margin-top: 2em;
    125         margin-bottom: 0.5em;
    126         padding-top: 0.6em;
    127         height: 2em;
    128 }
    129 
    130 form p {
    131         height: 3em;
    132         margin: 0em;
    133 }
    134 
    135 form p input {
    136         border: 1px solid #ACDFAC;
    137         height: 3em;
    138         width: 100%;
    139         font-weight: normal;
    140         margin-top: 1em;
    141 }
    142 
    143 .formButtons {
    144         text-align: center;
    145         margin-top: 3em;
    146 }
    147 
    148 .button {
    149         border: 0;
    150         height: 3em;
    151         width: 100%;
    152         background-repeat: no-repeat;
    153         background-position: 0.5em 0.25em;
    154         background-size: auto 1.5em;
    155         text-align: left;
    156         padding-left: 2.5em;
    157         font-weight: bold;
    158 
    159 }
    160 
    161118#shutdown {
    162119        width: 100%;
    … …  
    164121}
    165122
    166 #shutdown button {
     123.shutdown-button {
    167124        background-color: #8C1C00;
    168125        color: white;
  • src/webapp/webclient/js/main.js

    r0e71877 r4972eea  
    121121}
    122122
     123function uploadMap(form)
     124{
     125        $.ajax({
     126                type: "POST",
     127                url: "../webservice/mapupload.php",
     128                data: $(form).serialize(),
     129                success: function(data){
     130                        if(("error" in data) && data["error"] == 1){
     131                                alert("Failed to upload map: "+ data["errormessage"]);
     132                                return;
     133                        }
     134                        alert("Map upload successfully");
     135                },
     136                error: function(jqXHR, exception, errorThrown){ alert("Failed to upload map: "+ exception); }
     137        });
     138}
     139
     140
    123141$(document).ready(function() {
    124142        displayDataGet();
    … …  
    127145        $.getJSON("../webservice/tileserver.php?/map.json", mapSetup);
    128146       
    129         $("#shutdownButton").click(shutdown);
     147        $("shutdown").click(shutdown);
     148       
     149        $("#mapTileUpload").validate({
     150                rules: {
     151                        mapFile: {
     152                                required: true
     153                        }
     154                },
     155                submitHandler: function(form){
     156                        uploadMap(form);
     157                }
     158        });
    130159});
Note: See TracChangeset for help on using the changeset viewer.