Skip to content

Commit

Permalink
Merge pull request #70 from KlausBenndorf/merger
Browse files Browse the repository at this point in the history
Version update (includes updated requirements)
  • Loading branch information
penpendede authored Jan 19, 2017
2 parents b98aa82 + 4a56fb1 commit 36c5fff
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
language: node_js
node_js:
- 'node'
cache:
directories:
- travis_phantomjs
- node_modules
before_install:
# Upgrade PhantomJS to v2.1.1
- "export PHANTOMJS_VERSION=2.1.1"
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
- "phantomjs --version"
10 changes: 9 additions & 1 deletion conf/client.commented.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,16 @@
"scaleLine",
"zoom",
"mobileControls",
"searchControl"
"searchControl",
"helpButton"
],
"helpButton": {
"float": [
"top",
"left"
],
"fileName": "files/helptext.json"
},
"searchControl": {
"float": [
"top",
Expand Down
2 changes: 2 additions & 0 deletions conf/clouds.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@
@g4u-active-hover-button-color: rgb( 41, 171, 226);

@g4u-link-color: lighten(@g4u-medium-main-color, 10%);

@g4u-text-color: white;
25 changes: 25 additions & 0 deletions conf/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ import defaultClientConf from 'guide4you-builder/mustache-eval-loader?name=conf/
import defaultLayerConf from 'guide4you-builder/mustache-eval-loader?name=conf/[name].[ext]!./layers.commented.json'

import 'guide4you-builder/tojson-file-loader?name=files/[name]!../files/l10n.json.js'
import 'guide4you-builder/tojson-file-loader?name=files/[name]!../files/helptext.json.js'

import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/arrowbuttons.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/attribution-collapsed.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/attribution-expanded-de.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/attribution-expanded-en.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/button-area.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/button-documentation.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/button-geolocation-active.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/button-geolocation-inactive.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/button-info.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/button-lang-de.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/button-lang-en.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/button-line.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/button-print.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/layerselector-de.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/layerselector-en.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/overviewmap.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/overviewmap-collapsed.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/scaleline.png'
import 'file?name=images/doc/[name].[ext]!guide4you/images/doc/zoom.png'

import 'file?name=images/doc/[name].[ext]!../images/doc/search-active.png'
import 'file?name=images/doc/[name].[ext]!../images/doc/search-inactive-de.png'
import 'file?name=images/doc/[name].[ext]!../images/doc/search-inactive-en.png'

import 'file?name=files/[name].[ext]!guide4you/files/hotelsbonn.kml'
import 'file?name=files/[name].[ext]!guide4you/files/restaurantsbonn.kml'
Expand Down
35 changes: 35 additions & 0 deletions files/helptext.json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// As the webpack loader's exec method is broken we need to do plain ES5 here

var merge = require('lodash/merge')

module.exports = merge(require('guide4you/files/helptext.json.js'), {
"de": {
"searchControl": {
"img": [
"search-inactive-de.png",
"search-active.png"
],
"joinWith": "<br>&nbsp;<br>",
"descr": [
"Mit diesem Element suchen Sie nach Adressen, Orten, und &Auml;hnlichem. Tippen Sie den Such&shy;begriff in das Such&shy;feld ein.",
"W&auml;hlen Sie mit der Maus oder den Pfeil&shy;tasten aus den angezeigten Vorschl&auml;gen aus oder geben Sie den Such&shy;begriff vollst&auml;ndig ein. F&uuml;hren Sie die Suche aus, indem Sie die Enter-Taste bet&auml;tigen oder auf das Lupen&shy;symbol klicken.",
"Die obere Abbildung zeigt die Suche im inaktiven Zustand, die untere mit Vorschl&auml;gen."
]
}
},
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
"en": {
"searchControl": {
"img": [
"search-inactive-en.png",
"search-active.png"
],
"joinWith": "<br>&nbsp;<br>",
"descr": [
"Use this element to search for addresses, places and the like.",
"Type a search term into the search field. Choose among the suggestions using the mouse or the arrow buttons or enter the full search term. Execute the search by pressing the Enter button or clicking the magnifying glass symbol.",
"The upper image shows the search in inactive state, the lower image with suggestions being displayed."
]
}
}
})
Binary file added images/doc/search-active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/doc/search-inactive-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/doc/search-inactive-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "guide4you-module-search",
"version": "1.2.5",
"version": "1.3.0",
"description": "A search parser module for Guide4You.",
"keywords": [
"search",
Expand All @@ -21,18 +21,18 @@
"url": "https://github.com/KlausBenndorf/guide4you-module-search"
},
"dependencies": {
"guide4you": "1.2.*",
"guide4you": "1.3.*",
"guide4you-proxy": "github:KlausBenndorf/guide4you-proxy#v1.0.0"
},
"devDependencies": {
"guide4you-builder": "1.1.*",
"concurrently": "3.1.0",
"esdoc": "0.4.8",
"mocha": "3.1.2",
"selenium-webdriver": "2.53.3",
"phantomjs-prebuilt": "2.1.13",
"standard": "8.4.0",
"wait-on": "1.5.3"
"esdoc": "0.5.2",
"mocha": "3.2.0",
"selenium-webdriver": "3.0.1",
"phantomjs-prebuilt": "2.1.14",
"standard": "8.6.0",
"wait-on": "2.0.1"
},
"scripts": {
"linkRepos": "g4u-link guide4you",
Expand Down
21 changes: 17 additions & 4 deletions src/SearchControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ import '../less/searchcontrol.less'
* @property {number} [amountDropdownEntries=4] number of entries shown in the dropdown
* @property {number} [autocompleteStart=2] count of letters after which the autocomplete starts
* @property {number} [autocompleteDelay=300]
* @property {string} [projectionOfServer=interfaceProjection]
* @property {number} [slideDuration=400] time it takes for the dropdown to slide down
* @property {string} [parser] name of the parser to use. At the moment 'Nominatim' is delivered within this module.
* @property {StyleLike} [style] of the search results
* @property {boolean} [animated=true] affects the move to the search results.
* @property {boolean} [animated] affects the move to the search results.
* @property {string} [placeholder] text to be seen in the input field if the user has made no input yet
* @property {string} [ghostentry] text to be seen in the dropdown if the autocomplete or search didn't find
* any matching entries
Expand Down Expand Up @@ -61,7 +62,7 @@ export class SearchControl extends Control {
* @type {boolean}
* @private
*/
this.useProxy_ = (options.useProxy || (!options.hasOwnProperty('useProxy') && options.proxy))
this.useProxy_ = options.useProxy || (options.hasOwnProperty('useProxy') && options.proxy)

/**
* @type {string}
Expand Down Expand Up @@ -142,12 +143,22 @@ export class SearchControl extends Control {
* @type {boolean}
* @private
*/
this.animated_ = options.hasOwnProperty('animated') ? options.animated : false
this.animated_ = options.animated

/**
* @type {string}
* @private
*/
this.deactivateMobileSearch_ = options.hasOwnProperty('deactivateMobileSearch')
? options.deactivateMobileSearch
: DeactivateMobileSearch.EXACT

/**
* @type {string}
* @private
*/
this.projectionOfServer_ = options.projectionOfServer

let placeholder = (options.hasOwnProperty('placeholder'))
? this.getLocaliser().selectL10N(options.placeholder)
: this.getLocaliser().localiseUsingDictionary('SearchControl placeholder')
Expand Down Expand Up @@ -290,6 +301,7 @@ export class SearchControl extends Control {

this.parser_ = new this.parsers_[this.parserType_]({
featureProjection: map.getView().getProjection(),
dataProjection: this.projectionOfServer_ || map.get('interfaceProjection'),
localiser: this.getLocaliser()
})

Expand Down Expand Up @@ -400,7 +412,8 @@ export class SearchControl extends Control {
* @private
*/
updateDropdown_ () {
let inputContainsDropdown = (this.features_.length === 1) && (this.features_[0] === this.selectedFeature_)
let inputContainsDropdown = this.selectedFeature_ && (this.features_.length === 1) &&
(this.features_[0].get('dropdowntext') === this.selectedFeature_.get('dropdowntext'))

if (inputContainsDropdown || (this.features_.length === 0)) {
this.dropdownActive_ = false
Expand Down

0 comments on commit 36c5fff

Please sign in to comment.