Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rewrote the add place and address forms

  • Loading branch information...
commit 33367ce98733b39b6088d6034a032e385204f602 1 parent 4134a26
Asem Radhwi authored
26 geocamCover/static/javascripts/app.js
View
@@ -130,14 +130,14 @@ $(document).ready(function () {
if (isTapHold) {
isTapHold = false;
clickedPosition = event.latLng;
- showForm('place');
+ showPage('#place-form')
}
});
}});
-// $('#map_canvas').taphold(function(){
-// isTapHold = true;
-// });
+ $('#map_canvas').click(function(){
+ isTapHold = true;
+ });
google.maps.event.addListener(globalMap, 'zoom_changed', function() {
zoom = true;
@@ -211,7 +211,7 @@ function savePlace(place, which) {
$('#' + which + '-name').val("");
$('#' + which + '-categories-select').val("0");
$('#' + which + '-categories-select').parent().find('.ui-btn-text').html("Select Category");
- hideForm(which);
+
}
function addPlace(place) {
@@ -486,20 +486,6 @@ function showEditLogItem(which) {
showPage('#' + which + 's-page');
}
-function showForm(which) {
- $('#footer').hide();
- $('#' + which + '-form').show();
- $('#' + which + '-categories-select').parent().find('.ui-btn-text').html("Select Category");
- $('#dim').show();
-}
-
-function hideForm(which) {
- $('#dim').hide();
- $('#' + which + '-form').hide();
- $('#footer').show();
- pageResize();
-}
-
function populateTasksForReport(selectedId) {
$("#reports-page .task").empty();
var selected = selectedId == null ? " selected" : "";
@@ -551,7 +537,7 @@ function pageResize() {
}
- $('#map_canvas, #place-form, #address-form, #dim').height(page_height);
+ $('#map_canvas, #dim').height(page_height);
}
function initiateGeolocation() {
30 geocamCover/static/stylesheets/layout.css
View
@@ -1,5 +1,5 @@
html, body {
- background: blue;
+ background: #EEEEEE;
padding: 0;
margin: 0;
}
@@ -18,19 +18,20 @@ html, body {
}
#place-form, #address-form {
- position: absolute;
+ position: relative;
+ /*bottom: 0px;*/
z-index: 10;
width: 100%;
- height: 100%;
display: none;
}
#place-form form, #address-form form {
- position: absolute;
- bottom: 0px;
+ position: relative;
+ /*bottom: 0px;*/
width: 100%;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #EEE), color-stop(1, #DDD));
text-align: center;
+ padding-bottom: 15px;
}
#dim {
@@ -46,10 +47,7 @@ html, body {
.label {
font-size: larger;
font-family: Helvetica, Arial, sans-serif;
-}
-
-select {
- background: #F0F0F0;
+ padding-top: 10px;
}
.button {
@@ -91,7 +89,7 @@ select {
margin: .6em 110px .8em;
}
-.footer{
+.footer {
position: relative;
height: 50px;
}
@@ -107,7 +105,9 @@ select {
display: block;
text-align: center;
position: relative;
- margin: .5em 5px;
+ margin: 5px auto;
+ margin-top: 10px;
+ margin-bottom: 10px;
padding: .6em 25px;
height: 100%;
text-overflow: ellipsis;
@@ -215,12 +215,14 @@ input[type="text"] {
}
select {
- margin: 8px 0;
- width: 100%;
+ margin: 8px auto;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ width: 95%;
font-size: larger;
padding: .6em 25px;
display: block;
- height: 100%;
+ height: 35px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
60 geocamCover/templates/geocamCover/index.html
View
@@ -22,41 +22,43 @@
<div class='mobile-page' id="map-page">
<div id="map-header" class='header ui-bar-a ui-header'>
- <h1 class='ui-title'>GeoCam Cover</h1>
- </div>
-
- <div style='padding:0px'>
-
- <div id="dim"></div>
- <div id="map_canvas"></div>
- <div id="place-form">
- <form id="place-form-form">
- <h1>Do you want to add this as a place?</h1>
- <input style='width:95%' id="place-name" type="text" placeholder="Place Name... (optional)"/>
- <select id="place-categories-select" class="categories"></select>
- <input type="submit" value="Add Place"/>
- <input type="button" value="Back to Map" onclick="hideForm('place');"/>
- </form>
- </div>
-
- <div id="address-form">
- <form id="address-form-form">
- <h1>Please enter an address</h1>
- <input style='width:95%' id="address-name" type="text" placeholder="Enter Address..."/>
- <select id="address-categories-select" class="categories"></select>
- <input type="submit" value="Add Place"/>
- <input type="button" value="Back to Map" onclick="hideForm('address');"/>
- </form>
- </div>
+ <h1 class='ui-title' style="margin-left: 0px;margin-right: 0px;">GeoCam Cover</h1>
</div>
+ <div id="map_canvas"></div>
<div id="footer" class="footer ui-bar-a ui-header">
- <input type='submit' onclick="return showForm('address');" id="show-address-button" class='button ui-btn-left'
- value="Enter Address"/>
+ <input type='submit' onclick="return showPage('#address-form');" id="show-address-button" class='button ui-btn-left'
+ value="Add Address"/>
<input id="switch-view-button" class="button ui-btn-right" type='submit' onclick="return switchViews();"
value='Report View'/>
</div>
</div>
+<div class="mobile-page" id="address-form">
+ <div class='header ui-bar-a ui-header'>
+ <h1 class='ui-title' style="margin-left: 0px;margin-right: 0px;">Add Place</h1>
+ </div>
+ <form id="address-form-form">
+ <h1 class="page-h1">Please enter an address:</h1>
+ <input style='width:95%' id="address-name" type="text" placeholder="Enter Address..."/>
+ <select id="address-categories-select" class="categories"></select>
+ <input class="big-button" type="submit" value="Add Place"/>
+ <input class="big-button" type="button" value="Back to Map" onclick="showMap();"/>
+ </form>
+</div>
+
+<div class="mobile-page" id="place-form">
+ <div class='header ui-bar-a ui-header'>
+ <h1 class='ui-title' style="margin-left: 0px;margin-right: 0px;">Add Place</h1>
+ </div>
+ <form id="place-form-form">
+ <h1 class="page-h1">Do you want to add this as a place?</h1>
+ <input style='width:95%' id="place-name" type="text" placeholder="Place Name... (optional)"/>
+ <select id="place-categories-select" class="categories"></select>
+ <input class="big-button" type="submit" value="Add Place"/>
+ <input class="big-button" type="button" value="Back to Map" onclick="showMap();"/>
+ </form>
+</div>
+
<div class='mobile-page' id="logs-page">
<div class='header ui-bar-a ui-header'>
@@ -175,7 +177,7 @@ <h1 class='ui-title'>Place</h1>
<input class='button ui-btn-right' type='submit' onclick="return deletePlace();" value='Delete'/>
</div>
- <h1 class='page-h1' id='report-name-h1'>Edit '<span class='name'></span>'</h1>
+ <h1 class='page-h1'>Edit '<span class='name'></span>'</h1>
<div>
<form id="edit-place-page-form">
Please sign in to comment.
Something went wrong with that request. Please try again.