[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH 18/24] More work on the form behavior, added inf
From: |
Maxime Petazzoni |
Subject: |
[Maposmatic-dev] [PATCH 18/24] More work on the form behavior, added info note for unselectable items |
Date: |
Sun, 10 Jan 2010 15:54:12 +0100 |
---
www/media/osm_map.js | 29 +++++++++++++++++++++--------
www/media/style.css | 24 ++++++++++++++++++------
www/templates/maposmatic/new.html | 6 +++---
3 files changed, 42 insertions(+), 17 deletions(-)
diff --git a/www/media/osm_map.js b/www/media/osm_map.js
index 72b0117..103710c 100644
--- a/www/media/osm_map.js
+++ b/www/media/osm_map.js
@@ -93,18 +93,28 @@ function mapInit()
updateMap();
}
+function setFormActivation(active) {
+ if (active) {
+ $('#map_language').show();
+ $('#id_go_next_btn').show()
+ .removeAttr('disabled');
+ } else {
+ $('#map_language').hide();
+ $('#id_go_next_btn').hide()
+ .attr('disabled', 'disabled');
+ }
+}
+
function switchToAdminMode() {
$('#mapform tbody').children('tr.bybbox').hide();
$('#mapform tbody').children('tr.byadmin').show();
- $('#map_language').hide();
- $('#id_go_next_btn').hide();
+ setFormActivation(false);
}
function switchToBBoxMode() {
$('#mapform tbody').children('tr.byadmin').hide();
$('#mapform tbody').children('tr.bybbox').show();
- $('#map_language').show();
- $('#id_go_next_btn').show().removeAttr('disabled');
+ setFormActivation(true);
if (map == null)
mapInit();
}
@@ -147,6 +157,7 @@ function suggest(input, results, osm_id, button, options) {
}
function handleNominatimResults(data, textResult) {
+ var unusable_token = false;
closeSuggest();
if (data.length)
@@ -162,8 +173,12 @@ function suggest(input, results, osm_id, button, options) {
} else {
$results.append('<li class="suggestoff">'
+ item.display_name + '</li>');
+ unusable_token = true;
}
});
+
+ if (unusable_token)
+ $results.append('<li class="info">' + $('#noadminlimitinfo').html() +
'</li>');
}
function processKey(e) {
@@ -197,8 +212,7 @@ function suggest(input, results, osm_id, button, options) {
function clearResult() {
$osm_id.val('');
- $button.attr('disabled', 'disabled');
- $button.hide();
+ setFormActivation(false);
}
/* Returns the currently selected result. */
@@ -221,8 +235,7 @@ function suggest(input, results, osm_id, button, options) {
$osm_id.val(elt.attr('id').substring(3));
$input.val(elt.html());
closeSuggest();
- $button.removeAttr('disabled');
- $button.show();
+ setFormActivation(true);
}
function setSelectedResultTo(elt) {
diff --git a/www/media/style.css b/www/media/style.css
index d1fe4a6..9a9c651 100644
--- a/www/media/style.css
+++ b/www/media/style.css
@@ -270,6 +270,10 @@ a.selectedletter {
/* Map form */
+#mapform {
+ width: 100%;
+}
+
#mainfrm {
padding: 0 0 1em 1em;
margin: 1em 1em;
@@ -295,9 +299,10 @@ a.selectedletter {
border: 1px black solid;
}
-#mainfrm td.submit {
- text-align: right;
- padding-right: 1em;
+#mainfrm input[type=submit] {
+ margin-top: 0.5em;
+ font-size: 14pt;
+ width: 150px;
}
#id_go_next_btn {
@@ -306,7 +311,8 @@ a.selectedletter {
#mainfrm input#id_maptitle,
#mainfrm input#id_administrative_city {
- width: 600px;
+ width: 80%;
+ max-width: 600px;
font-size: 13pt;
}
@@ -340,14 +346,20 @@ a.selectedletter {
}
#suggest li.suggestoff {
- color: grey;
+ color: #ccc;
}
#suggest li.suggestoff:hover {
- background: #dedede;
+ background: #f0f0f0;
cursor: help;
}
+#suggest li.info {
+ color: #ccc;
+ padding: 0.5em 0 2px 3px;
+ font-size: 8pt;
+}
+
#suggest span.suggestid {
display: none;
}
diff --git a/www/templates/maposmatic/new.html
b/www/templates/maposmatic/new.html
index a0d41db..dae8ee4 100644
--- a/www/templates/maposmatic/new.html
+++ b/www/templates/maposmatic/new.html
@@ -97,12 +97,12 @@ map.{% endblocktrans %}
</td></tr>
<tr><td class="submit">
- <input id="id_go_next_btn" type="image" src="/smedia/go-next.png"
- value="{% trans "Generate" %}" disabled="disabled"
- title="{% trans "Please fill in the form before trying to
proceed" %}" />
+ <input id="id_go_next_btn" type="submit"
+ value="{% trans "Generate" %}" disabled="disabled" />
</td></tr>
</table>
</form>
+<span id="noadminlimitinfo">{% blocktrans %}Wondering why you can't choose
some of these results?<br />Their administrative boundaries are missing from
the OSM database.<br />Look at the <a
href="http://wiki.maposmatic.org/doku.php?id=faq">FAQ</a> for more details.{%
endblocktrans %}</span>
{% endblock %}
--
1.6.3.3.261.g85c6
- [Maposmatic-dev] [PATCH 08/24] New header background, (continued)
- [Maposmatic-dev] [PATCH 08/24] New header background, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 09/24] Complete site-wide UI overhaul., Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 10/24] Updated translations to follow the small changes made during the redesign., Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 11/24] Small typographic fix, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 12/24] Add a link on the header, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 13/24] HTML fixes, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 14/24] New automatic suggestion mechanism, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 15/24] Restored the two columns layout., Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 16/24] Put the map generation form on its own page, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 17/24] PO file update for UI changes. French is translated, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 18/24] More work on the form behavior, added info note for unselectable items,
Maxime Petazzoni <=
- [Maposmatic-dev] [PATCH 19/24] Cleanup and comment the suggest JS code, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 20/24] Removed JQuery from the main page, it's not needed there, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 21/24] Finished the form behavior with language preselection, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 22/24] PO files update, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 23/24] Fix layout and stylesheet for browser compatibility, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH 24/24] Improve suggest box behavior and usability, Maxime Petazzoni, 2010/01/10
- [Maposmatic-dev] [PATCH] Avoid resetting the language selector with empty contents, Maxime Petazzoni, 2010/01/10