[Mapbender-commits] r8443 - trunk/mapbender/http/plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Jul 9 08:06:01 PDT 2012
Author: armin11
Date: 2012-07-09 08:06:01 -0700 (Mon, 09 Jul 2012)
New Revision: 8443
Modified:
trunk/mapbender/http/plugins/mod_jsonAutocompleteGazetteer.php
Log:
Enhancement: Show Help for address search with autocomplete editor - todo: i18
Modified: trunk/mapbender/http/plugins/mod_jsonAutocompleteGazetteer.php
===================================================================
--- trunk/mapbender/http/plugins/mod_jsonAutocompleteGazetteer.php 2012-07-09 15:05:22 UTC (rev 8442)
+++ trunk/mapbender/http/plugins/mod_jsonAutocompleteGazetteer.php 2012-07-09 15:06:01 UTC (rev 8443)
@@ -96,6 +96,9 @@
if (options.gazetteerFrontImageOff === undefined) {
options.gazetteerFrontImageOff = "../img/button_blue_red/gazetteer3_off.png";
}
+if (options.helpText === undefined) {
+ options.helpText = "";
+}
var JsonAutocompleteGazetteer = function() {
var that = this;
@@ -162,13 +165,18 @@
});
req.send();
};
+ this.showSearchHelp = function(){
+
+ }
this.toggleInput = function(){
if ($("#geographicName").css("display") == 'none') {
$("#geographicName").show();
+ $("#helpSymbolId").show();
$("#symboldForInputId").attr({'src':options.gazetteerFrontImageOn});
} else {
$("#geographicName").hide();
+ $("#helpSymbolId").hide();
$("#symboldForInputId").attr({'src':options.gazetteerFrontImageOff});
}
}
@@ -186,10 +194,35 @@
this.symbolForInput.attr({'id':'symboldForInputId'});
this.symbolForInput.attr({'src':options.gazetteerFrontImageOn});
this.symbolForInput.attr({'title':'<?php echo _mb('Address'); ?>'});
- this.symbolForInput.click(function() {
+ $("#symboldForInputId").click(function() {
that.toggleInput();
});
this.inputAddress = $(document.createElement('input')).appendTo(this.formContainer);
+
+ //do the following things only if
+ if (options.helpText != '') {
+ this.helpSymbol = $(document.createElement('img')).appendTo(this.formContainer);
+
+ this.helpText = $(document.createElement('div')).appendTo(this.formContainer);
+ this.helpText.attr({'id':'helpTextId'});
+ $("#helpTextId").append(options.helpText);
+
+ this.helpSymbol.attr({'id':'helpSymbolId'});
+ this.helpSymbol.attr({'src':'../img/questionmark.png'});
+ this.helpSymbol.attr({'width':'17'});
+ this.helpSymbol.attr({'height':'17'});
+
+ $("#helpSymbolId").hover(
+ function () {
+ //create dialog
+ $("#helpTextId").dialog({ title: "<?php echo _mb('Help for address search'); ?>" });
+ },
+ function () {
+ //create dialog
+ $("#helpTextId").dialog('close');
+ }
+ );
+ }
this.inputAddress.attr({'id':'geographicName'});
//default value
this.inputAddress.val('<?php echo _mb('Search for addresses'); ?>');
More information about the Mapbender_commits
mailing list