Modify composer.json 85/29585/2
authorSebastian Fischer <typo3@evoweb.de>
Fri, 28 Mar 2014 21:12:29 +0000 (22:12 +0100)
committerSebastian Fischer <typo3@evoweb.de>
Sun, 20 Apr 2014 15:21:54 +0000 (17:21 +0200)
Add documentation
Modify session handling
Add fal handling
Cleanup InfoBubble
Add image rendering for info window
Add image migration to update utility
Add caching framework for coordinates
Add configurable valiator

Change-Id: I84a1d201ae85216219ff73bb30bdc457b0062689
Reviewed-on: https://review.typo3.org/29585
Reviewed-by: Sebastian Fischer
Tested-by: Sebastian Fischer
48 files changed:
.phpstorm.meta.php [new file with mode: 0644]
Classes/Cache/CoordinatesCache.php [new file with mode: 0644]
Classes/Controller/MapController.php
Classes/Domain/Model/Attribute.php
Classes/Domain/Model/Location.php
Classes/Domain/Repository/SessionRepository.php [deleted file]
Classes/Hook/TceMainHook.php
Classes/Service/GeocodeService.php
Classes/Utility/UpdateUtility.php
Classes/Validation/Validator/ConstraintValidator.php [new file with mode: 0644]
Classes/Validation/Validator/RequiredValidator.php [new file with mode: 0644]
Classes/Validation/ValidatorResolver.php [new file with mode: 0644]
Configuration/FlexForms/flexform_ds.xml
Configuration/TCA/tx_storefinder_domain_model_attribute.php
Configuration/TCA/tx_storefinder_domain_model_location.php
Configuration/TypoScript/setup.txt
Documentation/Administration/Index.rst [new file with mode: 0644]
Documentation/Configuration/Index.rst [new file with mode: 0644]
Documentation/Images/admin_config.png [new file with mode: 0644]
Documentation/Images/introduction_result.png [new file with mode: 0644]
Documentation/Images/introduction_search.png [new file with mode: 0644]
Documentation/Includes.txt [new file with mode: 0644]
Documentation/Index.rst [new file with mode: 0644]
Documentation/Introduction/Index.rst [new file with mode: 0644]
Documentation/Settings.yml [new file with mode: 0644]
Documentation/Targets.rst [new file with mode: 0644]
Documentation/Templating/Index.rst [new file with mode: 0644]
Documentation/Tutorial/Index.rst [new file with mode: 0644]
Documentation/UserManual/Index.rst [new file with mode: 0644]
Documentation/_make/Makefile [new file with mode: 0644]
Documentation/_make/_not_versioned/.gitignore [new file with mode: 0644]
Documentation/_make/build/.gitignore [new file with mode: 0644]
Documentation/_make/conf.py [new file with mode: 0644]
Documentation/_make/make-html.bat [new file with mode: 0644]
Documentation/_make/make.bat [new file with mode: 0644]
Documentation/license.txt
Resources/Private/Language/locallang.xlf
Resources/Private/Partials/FieldError.html
Resources/Private/Partials/Map.html
Resources/Public/JavaScript/InfoBubble.js
Resources/Public/JavaScript/jquery-1.10.2.min.js
Resources/Public/JavaScript/map.js
Tests/Unit/Cache/AddLocationToCacheTest.php [new file with mode: 0644]
composer.json
ext_emconf.php
ext_icon.gif
ext_localconf.php
ext_tables.sql

diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php
new file mode 100644 (file)
index 0000000..8a7f5e0
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+namespace PHPSTORM_META {
+       /** @noinspection PhpUnusedLocalVariableInspection */
+       /** @noinspection PhpIllegalArrayKeyTypeInspection */
+       /** @noinspection PhpDynamicAsStaticMethodCallInspection */
+       $STATIC_METHOD_TYPES = [
+               \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('') => [
+                       'Evoweb\\StoreFinder\\Service\\GeocodeService' instanceof \Evoweb\StoreFinder\Service\GeocodeService,
+               ],
+               \TYPO3\CMS\Extbase\Object\ObjectManager::get('') => [
+                       'Evoweb\\StoreFinder\\Service\\GeocodeService' instanceof \Evoweb\StoreFinder\Service\GeocodeService,
+               ],
+       ];
+}
diff --git a/Classes/Cache/CoordinatesCache.php b/Classes/Cache/CoordinatesCache.php
new file mode 100644 (file)
index 0000000..9a18989
--- /dev/null
@@ -0,0 +1,268 @@
+<?php
+namespace Evoweb\StoreFinder\Cache;
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2014 Sebastian Fischer <typo3@evoweb.de>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use Evoweb\StoreFinder\Domain\Model;
+
+/**
+ * Class CoordinatesCache
+ *
+ * @package Evoweb\StoreFinder\Domain\Repository
+ */
+class CoordinatesCache {
+       /**
+        * @var \TYPO3\CMS\Core\Database\DatabaseConnection
+        */
+       protected $database;
+
+       /**
+        * @var \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication
+        * @inject
+        */
+       protected $frontendUser = NULL;
+
+       /**
+        * @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
+        */
+       protected $cacheFrontend;
+
+       /**
+        * @var array
+        */
+       protected $fieldCombinations = array(
+               array('address', 'zipcode', 'city', 'state', 'country'),
+               array('zipcode', 'city', 'country'),
+               array('city', 'country'),
+       );
+
+
+       /**
+        * Constructor
+        *
+        * @throws \TYPO3\CMS\Core\Cache\Exception\InvalidBackendException
+        * @throws \TYPO3\CMS\Core\Cache\Exception\InvalidCacheException
+        * @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
+        * @return self
+        */
+       public function __construct() {
+               $this->database = $GLOBALS['TYPO3_DB'];
+
+               /** @var \TYPO3\CMS\Core\Cache\CacheManager $cacheManager */
+               $cacheManager = $GLOBALS['typo3CacheManager'];
+               $this->cacheFrontend = $cacheManager->getCache('store_finder_coordinate');
+       }
+
+
+       /**
+        * Add calculated coordinate for hash
+        *
+        * @param Model\Constraint|Model\Location $address
+        * @param array $fields
+        * @throws \TYPO3\CMS\Core\Exception
+        * @return void
+        */
+       public function addCoordinateForAddress($address, $fields) {
+               $coordinate = array(
+                       'latitude' => $address->getLatitude(),
+                       'longitude' => $address->getLongitude()
+               );
+
+               $hash = $this->getHashForAddressWithFields($address, $fields);
+               if (count($fields) <= 3) {
+                       $this->setValueInCacheTable($hash, $coordinate);
+               } else {
+                       $this->setValueInSession($hash, $coordinate);
+               }
+       }
+
+       /**
+        * Get coordinate by address
+        *
+        * @param Model\Constraint $address
+        * @return Model\Constraint|Model\Location
+        */
+       public function getCoordinateByAddress($address) {
+               $coordinate = NULL;
+
+               foreach ($this->fieldCombinations as $fields) {
+                       $hash = $this->getHashForAddressWithFields($address, $fields);
+
+                       if ($hash) {
+                               if (count($fields) <= 3) {
+                                       $coordinate = $this->getValueFromCacheTable($hash);
+                               } elseif ($this->sessionHasKey($hash)) {
+                                       $coordinate = $this->getValueFromSession($hash);
+                               }
+
+                               if (is_array($coordinate)) {
+                                       $address->getLatitude($coordinate['latitude']);
+                                       $address->getLongitude($coordinate['longitude']);
+                                       break;
+                               }
+                       }
+               }
+
+               return $address;
+       }
+
+       /**
+        * Get hash for address with field values
+        *
+        * @param Model\Constraint|Model\Location $address
+        * @param array &$fields
+        * @return string
+        */
+       public function getHashForAddressWithFields($address, &$fields) {
+               $values = array();
+
+               foreach ($fields as $field) {
+                       $methodName = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $field)));
+                       $value = $address->{$methodName}();
+
+                       if ($value) {
+                               $values[$field] = $value;
+                       }
+               }
+
+               asort($values);
+               $fields = array_keys($values);
+
+               return md5(serialize(array_values($values)));
+       }
+
+       /**
+        * Flush both caches
+        *
+        * @throws \TYPO3\CMS\Core\Exception
+        * @return void
+        */
+       public function flushCache() {
+               $this->flushCacheTable();
+               $this->flushSessionCache();
+       }
+
+
+       /**
+        * Check if session has key set and the value is not empty
+        *
+        * @param string $key
+        * @return bool
+        */
+       public function sessionHasKey($key) {
+               $sessionData = NULL;
+
+               if ($this->frontendUser != NULL) {
+                       $sessionData = $this->frontendUser->getKey('ses', 'tx_storefinder_coordinates');
+               }
+
+               return is_array($sessionData) && isset($sessionData[$key]) && !empty($sessionData[$key]);
+       }
+
+       /**
+        * Fetch value for hash from session
+        *
+        * @param string $key
+        * @return array
+        */
+       public function getValueFromSession($key) {
+               $sessionData = NULL;
+
+               if ($this->frontendUser != NULL) {
+                       $sessionData = $this->frontendUser->getKey('ses', 'tx_storefinder_coordinates');
+               }
+
+               return is_array($sessionData) && isset($sessionData[$key]) ? unserialize($sessionData[$key]) : NULL;
+       }
+
+       /**
+        * Store coordinate for hash in session
+        *
+        * @param string $key
+        * @param array $value
+        * @throws \TYPO3\CMS\Core\Exception
+        * @return void
+        */
+       public function setValueInSession($key, $value) {
+               if ($this->frontendUser != NULL) {
+                       $sessionData = $this->frontendUser->getKey('ses', 'tx_storefinder_coordinates');
+
+                       $sessionData[$key] = serialize($value);
+
+                       $this->frontendUser->setKey('ses', 'tx_storefinder_coordinates', $sessionData);
+                       $this->frontendUser->storeSessionData();
+               }
+       }
+
+       /**
+        * Flush session cache
+        *
+        * @throws \TYPO3\CMS\Core\Exception
+        * @return void
+        */
+       public function flushSessionCache() {
+               $this->frontendUser->setKey('ses', 'tx_storefinder_coordinates', array());
+               $this->frontendUser->storeSessionData();
+       }
+
+
+       /**
+        * Check if cache table has key set
+        *
+        * @param string $key
+        * @return bool
+        */
+       public function cacheTableHasKey($key) {
+               return $this->cacheFrontend->has($key) && $this->getValueFromCacheTable($key) !== FALSE;
+       }
+
+       /**
+        * Fetch value for hash from session
+        *
+        * @param string $key
+        * @return array
+        */
+       public function getValueFromCacheTable($key) {
+               return $this->cacheFrontend->get($key);
+       }
+
+       /**
+        * Store coordinate for hash in cache table
+        *
+        * @param string $key
+        * @param array $value
+        * @return void
+        */
+       public function setValueInCacheTable($key, $value) {
+               $this->cacheFrontend->set($key, $value);
+       }
+
+       /**
+        * Flush data from cache table
+        *
+        * @return void
+        */
+       public function flushCacheTable() {
+               $this->cacheFrontend->flush();
+       }
+}
\ No newline at end of file
index a6c7192..cca9102 100644 (file)
@@ -45,10 +45,11 @@ class MapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
        protected $categoryRepository;
 
        /**
-        * @var \Evoweb\StoreFinder\Domain\Repository\SessionRepository
+        * @var \Evoweb\StoreFinder\Service\GeocodeService
         * @inject
         */
-       protected $sessionRepository;
+       protected $geocodeService;
+
 
        /**
         * Initializes the controller before invoking an action method.
@@ -59,6 +60,13 @@ class MapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
         * @return void
         */
        protected function initializeAction() {
+               if (isset($this->settings['override']) && is_array($this->settings['override'])) {
+                       $override = $this->settings['override'];
+                       unset($this->settings['override']);
+
+                       $this->settings = array_merge($this->settings, $override);
+               }
+
                $this->settings['allowedCountries'] = explode(',', $this->settings['allowedCountries']);
                $this->locationRepository->setSettings($this->settings);
        }
@@ -67,12 +75,16 @@ class MapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
         * Action responsible for rendering search, map and list partial
         *
         * @param Model\Constraint $search
+        * @throws \BadFunctionCallException
+        * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception
         * @return void
+        * @validate $search Evoweb.StoreFinder:Constraint
         */
        public function mapAction(Model\Constraint $search = NULL) {
                $afterSearch = 0;
+
                if ($search !== NULL) {
-                       $search = $this->geocodeAddress($search);
+                       $search = $this->geocodeService->geocodeAddress($search);
                        $locations = $this->locationRepository->findByConstraint($search);
 
                        $center = $this->getCenter($search);
@@ -81,7 +93,7 @@ class MapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
                        $afterSearch = 1;
 
                        $this->view->assign('center', $center);
-                       $this->view->assign('numberOfLocations', is_object($locations) ? count($locations) : $locations->count());
+                       $this->view->assign('numberOfLocations', is_array($locations) ? count($locations) : $locations->count());
                        $this->view->assign('locations', $locations);
                } elseif ($this->settings['singleLocationId']) {
                        $location = $this->locationRepository->findByUid($this->settings['singleLocationId']);
@@ -100,6 +112,7 @@ class MapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
                $this->view->assign('static_info_tables', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables') ? 1 : 0);
        }
 
+
        /**
         * Add categories give in settings to view
         *
@@ -154,6 +167,7 @@ class MapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
         * flagged as center. If
         *
         * @param Model\Constraint $constraint
+        * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception
         * @return Model\Location
         */
        protected function getCenter(Model\Constraint $constraint = NULL) {
@@ -166,7 +180,7 @@ class MapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
                                $center->setLatitude($constraint->getLatitude());
                                $center->setLongitude($constraint->getLongitude());
                        } else {
-                               $center = $this->geocodeAddress($constraint);
+                               $center = $this->geocodeService->geocodeAddress($constraint);
                        }
                }
 
@@ -182,33 +196,6 @@ class MapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
        }
 
        /**
-        * Geocode address and retries if first attempt or value in session
-        * is not geocoded
-        *
-        * @param Model\Constraint $address
-        * @param bool $forceGeocoding
-        * @return Model\Constraint
-        */
-       protected function geocodeAddress($address, $forceGeocoding = FALSE) {
-               $hash = md5(serialize($address));
-
-               if (!($geocodedAddress = $this->sessionRepository->getCoordinateByHash($hash)) || $forceGeocoding) {
-                       $geocodedAddress = $this->objectManager
-                               ->get('Evoweb\\StoreFinder\\Service\\GeocodeService', $this->settings)
-                               ->geocodeAddress($address);
-                       $this->sessionRepository->addCoordinateForHash($geocodedAddress, $hash);
-               }
-
-                       // In case the address without geocoded location was stored in
-                       // session or the geocoding did not work a second try is done
-               if (!$geocodedAddress->isGeocoded() && !$forceGeocoding) {
-                       $geocodedAddress = $this->geocodeAddress($geocodedAddress, TRUE);
-               }
-
-               return $geocodedAddress;
-       }
-
-       /**
         * Set zoom level for map based on radius
         *
         * @param Model\Location|Model\Constraint $location
@@ -216,31 +203,26 @@ class MapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
         * @return Model\Location
         */
        protected function setZoomLevel($location, Model\Constraint $constraint) {
-               $zoom = 13;
-               if ($constraint->getRadius() > 500 && $constraint->getRadius() <= 1000) {
+               $radius = $constraint->getRadius();
+               if ($radius > 500 && $radius <= 1000) {
                        $zoom = 12;
-               }
-               if ($constraint->getRadius() <= 500) {
-                       $zoom = 10;
-               }
-               if ($constraint->getRadius() <= 100) {
-                       $zoom = 8;
-               }
-               if ($constraint->getRadius() <= 25) {
-                       $zoom = 6;
-               }
-               if ($constraint->getRadius() < 5) {
-                       $zoom = 4;
-               }
-               if ($constraint->getRadius() < 3) {
-                       $zoom = 3;
-               }
-               if ($constraint->getRadius() < 2) {
+               } elseif ($radius < 2) {
                        $zoom = 2;
+               } elseif ($radius < 3) {
+                       $zoom = 3;
+               } elseif ($radius < 5) {
+                       $zoom = 4;
+               } elseif ($radius <= 25) {
+                       $zoom = 7;
+               } elseif ($radius <= 100) {
+                       $zoom = 9;
+               } elseif ($radius <= 500) {
+                       $zoom = 11;
+               } else {
+                       $zoom = 13;
                }
 
-               $location->setZoom($zoom);
-
+               $location->setZoom(18 - $zoom);
                return $location;
        }
 }
\ No newline at end of file
index b507415..b43f608 100644 (file)
@@ -29,4 +29,53 @@ namespace Evoweb\StoreFinder\Domain\Model;
  * @package Evoweb\StoreFinder\Domain\Model
  */
 class Attribute extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
+       /**
+        * Image
+        * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
+        * @lazy
+        */
+       protected $icon;
+
+       /**
+        * @var string
+        */
+       protected $name;
+
+       /**
+        * Getter
+        *
+        * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
+        */
+       public function getIcon() {
+               return $this->icon;
+       }
+
+       /**
+        * Setter
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $icon
+        * @return void
+        */
+       public function setIcon($icon) {
+               $this->icon = $icon;
+       }
+
+       /**
+        * Getter
+        *
+        * @return string
+        */
+       public function getName() {
+               return $this->name;
+       }
+
+       /**
+        * Setter
+        *
+        * @param string $name
+        * @return void
+        */
+       public function setName($name) {
+               $this->name = $name;
+       }
 }
\ No newline at end of file
index b0b09bf..7948249 100644 (file)
@@ -162,17 +162,13 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        protected $related;
 
        /**
-        * @todo fal
-        * \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Core\Resource\File>
-        * @var string
+        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
         * @lazy
         */
        protected $image = '';
 
        /**
-        * @todo fal
-        * \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Core\Resource\File>
-        * @var string
+        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
         * @lazy
         */
        protected $media = '';
@@ -189,11 +185,13 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         */
        protected $state = '';
 
+
        /**
         * @var double
         */
        protected $distance = 0.0;
 
+
        /**
         * Initialize categories, attributed and media relation
         */
@@ -202,12 +200,21 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
                        $this->categories =
                        $this->content =
                        $this->related =
-                                       // $this->image =
-                                       // $this->media =
+                       $this->image =
+                       $this->media =
                                new ObjectStorage();
        }
 
        /**
+        * Getter
+        *
+        * @return string
+        */
+       public function getAdditionaladdress() {
+               return $this->additionaladdress;
+       }
+
+       /**
         * Setter
         *
         * @param string $additionaladdress
@@ -222,8 +229,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getAdditionaladdress() {
-               return $this->additionaladdress;
+       public function getAddress() {
+               return $this->escapeJsonString($this->address);
        }
 
        /**
@@ -239,16 +246,16 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Getter
         *
-        * @return string
+        * @return ObjectStorage<\Evoweb\StoreFinder\Domain\Model\Attribute>
         */
-       public function getAddress() {
-               return $this->escapeJsonString($this->address);
+       public function getAttributes() {
+               return $this->attributes;
        }
 
        /**
         * Setter
         *
-        * @param ObjectStorage $attributes
+        * @param ObjectStorage<\Evoweb\StoreFinder\Domain\Model\Attribute> $attributes
         * @return void
         */
        public function setAttributes($attributes) {
@@ -258,16 +265,16 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Getter
         *
-        * @return ObjectStorage
+        * @return ObjectStorage<\Evoweb\StoreFinder\Domain\Model\Category>
         */
-       public function getAttributes() {
-               return $this->attributes;
+       public function getCategories() {
+               return $this->categories;
        }
 
        /**
         * Setter
         *
-        * @param ObjectStorage $categories
+        * @param ObjectStorage<\Evoweb\StoreFinder\Domain\Model\Category> $categories
         * @return void
         */
        public function setCategories($categories) {
@@ -277,10 +284,10 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Getter
         *
-        * @return ObjectStorage
+        * @return string
         */
-       public function getCategories() {
-               return $this->categories;
+       public function getCity() {
+               return $this->escapeJsonString($this->city);
        }
 
        /**
@@ -298,8 +305,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getCity() {
-               return $this->escapeJsonString($this->city);
+       public function getPerson() {
+               return $this->person;
        }
 
        /**
@@ -317,8 +324,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getPerson() {
-               return $this->person;
+       public function getContent() {
+               return $this->content;
        }
 
        /**
@@ -336,18 +343,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getContent() {
-               return $this->content;
-       }
-
-       /**
-        * Setter
-        *
-        * @param \SJBR\StaticInfoTables\Domain\Model\Country $country
-        * @return void
-        */
-       public function setCountry($country) {
-               $this->country = $country;
+       public function getCountryName() {
+               return $this->getCountry() ? $this->getCountry()->getShortNameEn() : '';
        }
 
        /**
@@ -360,22 +357,13 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        }
 
        /**
-        * Getter for country name
-        *
-        * @return string
-        */
-       public function getCountryName() {
-               return $this->getCountry() ? $this->getCountry()->getShortNameEn() : '';
-       }
-
-       /**
         * Setter
         *
-        * @param string $email
+        * @param \SJBR\StaticInfoTables\Domain\Model\Country $country
         * @return void
         */
-       public function setEmail($email) {
-               $this->email = $email;
+       public function setCountry($country) {
+               $this->country = $country;
        }
 
        /**
@@ -390,11 +378,11 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Setter
         *
-        * @param string $fax
+        * @param string $email
         * @return void
         */
-       public function setFax($fax) {
-               $this->fax = $fax;
+       public function setEmail($email) {
+               $this->email = $email;
        }
 
        /**
@@ -409,11 +397,11 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Setter
         *
-        * @param int $geocode
+        * @param string $fax
         * @return void
         */
-       public function setGeocode($geocode) {
-               $this->geocode = $geocode;
+       public function setFax($fax) {
+               $this->fax = $fax;
        }
 
        /**
@@ -428,11 +416,11 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Setter
         *
-        * @param string $hours
+        * @param int $geocode
         * @return void
         */
-       public function setHours($hours) {
-               $this->hours = $hours;
+       public function setGeocode($geocode) {
+               $this->geocode = $geocode;
        }
 
        /**
@@ -447,11 +435,11 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Setter
         *
-        * @param string $icon
+        * @param string $hours
         * @return void
         */
-       public function setIcon($icon) {
-               $this->icon = $icon;
+       public function setHours($hours) {
+               $this->hours = $hours;
        }
 
        /**
@@ -466,17 +454,17 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Setter
         *
-        * @param string $image
+        * @param string $icon
         * @return void
         */
-       public function setImage($image) {
-               $this->image = $image;
+       public function setIcon($icon) {
+               $this->icon = $icon;
        }
 
        /**
         * Getter
         *
-        * @return string
+        * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
         */
        public function getImage() {
                return $this->image;
@@ -485,45 +473,26 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Setter
         *
-        * @param double $latitude
+        * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $image
         * @return void
         */
-       public function setLatitude($latitude) {
-               $this->latitude = (float) $latitude;
-       }
-
-       /**
-        * Getter
-        *
-        * @return double
-        */
-       public function getLatitude() {
-               return (float) $this->latitude;
-       }
-
-       /**
-        * Setter
-        *
-        * @param double $longitude
-        * @return void
-        */
-       public function setLongitude($longitude) {
-               $this->longitude = (float) $longitude;
+       public function setImage($image) {
+               $this->image = $image;
        }
 
        /**
         * Getter
         *
-        * @return double
+        * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
         */
-       public function getLongitude() {
-               return (float) $this->longitude;
+       public function getMedia() {
+               return $this->media;
        }
 
        /**
         * Setter
         *
-        * @param string $media
+        * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $media
         * @return void
         */
        public function setMedia($media) {
@@ -535,8 +504,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getMedia() {
-               return $this->media;
+       public function getMobile() {
+               return $this->mobile;
        }
 
        /**
@@ -554,8 +523,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getMobile() {
-               return $this->mobile;
+       public function getNotes() {
+               return $this->escapeJsonString($this->notes);
        }
 
        /**
@@ -573,8 +542,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getNotes() {
-               return $this->escapeJsonString($this->notes);
+       public function getPhone() {
+               return $this->phone;
        }
 
        /**
@@ -592,8 +561,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getPhone() {
-               return $this->phone;
+       public function getProducts() {
+               return $this->products;
        }
 
        /**
@@ -609,10 +578,10 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Getter
         *
-        * @return string
+        * @return ObjectStorage
         */
-       public function getProducts() {
-               return $this->products;
+       public function getRelated() {
+               return $this->related;
        }
 
        /**
@@ -628,10 +597,19 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Getter
         *
-        * @return ObjectStorage
+        * @return string
         */
-       public function getRelated() {
-               return $this->related;
+       public function getStateName() {
+               return $this->getState() ? $this->getState()->getNameEn() : '';
+       }
+
+       /**
+        * Getter
+        *
+        * @return \SJBR\StaticInfoTables\Domain\Model\CountryZone
+        */
+       public function getState() {
+               return $this->state;
        }
 
        /**
@@ -647,19 +625,10 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Getter
         *
-        * @return \SJBR\StaticInfoTables\Domain\Model\CountryZone
-        */
-       public function getState() {
-               return $this->state;
-       }
-
-       /**
-        * Getter state name
-        *
         * @return string
         */
-       public function getStateName() {
-               return $this->getState() ? $this->getState()->getNameEn() : '';
+       public function getStoreid() {
+               return $this->storeid;
        }
 
        /**
@@ -677,8 +646,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getStoreid() {
-               return $this->storeid;
+       public function getName() {
+               return $this->escapeJsonString($this->name);
        }
 
        /**
@@ -696,8 +665,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getName() {
-               return $this->escapeJsonString($this->name);
+       public function getUrl() {
+               return $this->url;
        }
 
        /**
@@ -715,8 +684,8 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         *
         * @return string
         */
-       public function getUrl() {
-               return $this->url;
+       public function getZipcode() {
+               return $this->zipcode;
        }
 
        /**
@@ -732,10 +701,10 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Getter
         *
-        * @return string
+        * @return bool
         */
-       public function getZipcode() {
-               return $this->zipcode;
+       public function getCenter() {
+               return (bool)$this->center;
        }
 
        /**
@@ -751,51 +720,69 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        /**
         * Getter
         *
-        * @return bool
+        * @return integer
         */
-       public function getCenter() {
-               return (bool)$this->center;
+       public function getZoom() {
+               return $this->zoom;
        }
 
        /**
         * Setter
         *
-        * @param float $distance
+        * @param integer $zoom
         * @return void
         */
-       public function setDistance($distance) {
-               $this->distance = $distance;
+       public function setZoom($zoom) {
+               $this->zoom = $zoom;
        }
 
        /**
         * Getter
         *
-        * @return float
+        * @return double
         */
-       public function getDistance() {
-               return $this->distance;
+       public function getLatitude() {
+               return (float) $this->latitude;
        }
 
-
        /**
         * Setter
         *
-        * @param integer $zoom
+        * @param double $latitude
         * @return void
         */
-       public function setZoom($zoom) {
-               $this->zoom = $zoom;
+       public function setLatitude($latitude) {
+               $this->latitude = (float) $latitude;
        }
 
        /**
         * Getter
         *
-        * @return integer
+        * @return double
         */
-       public function getZoom() {
-               return $this->zoom;
+       public function getLongitude() {
+               return (float) $this->longitude;
        }
 
+       /**
+        * Setter
+        *
+        * @param double $longitude
+        * @return void
+        */
+       public function setLongitude($longitude) {
+               $this->longitude = (float) $longitude;
+       }
+
+
+       /**
+        * Check if location has latitude and longitude
+        *
+        * @return bool
+        */
+       public function isGeocoded() {
+               return $this->getLatitude() && $this->getLongitude();
+       }
 
        /**
         * Escape values for json
@@ -811,11 +798,21 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        }
 
        /**
-        * Check if location has latitude and longitude
+        * Getter
         *
-        * @return bool
+        * @return float
         */
-       public function isGeocoded() {
-               return $this->getLatitude() && $this->getLongitude();
+       public function getDistance() {
+               return $this->distance;
+       }
+
+       /**
+        * Setter
+        *
+        * @param float $distance
+        * @return void
+        */
+       public function setDistance($distance) {
+               $this->distance = $distance;
        }
 }
\ No newline at end of file
diff --git a/Classes/Domain/Repository/SessionRepository.php b/Classes/Domain/Repository/SessionRepository.php
deleted file mode 100644 (file)
index a52275b..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-namespace Evoweb\StoreFinder\Domain\Repository;
-/***************************************************************
- * Copyright notice
- *
- * (c) 2014 Sebastian Fischer <typo3@evoweb.de>
- * All rights reserved
- *
- * This script is part of the TYPO3 project. The TYPO3 project is
- * free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * The GNU General Public License can be found at
- * http://www.gnu.org/copyleft/gpl.html.
- *
- * This script is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-use Evoweb\StoreFinder\Domain\Model;
-
-/**
- * Class SessionRepository
- *
- * @package Evoweb\StoreFinder\Domain\Repository
- */
-class SessionRepository {
-       /**
-        * @var \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication
-        */
-       protected $frontendUser;
-
-       /**
-        * Constructor
-        *
-        * @return self
-        */
-       public function __construct() {
-               $this->frontendUser = $GLOBALS['TSFE']->fe_user;
-       }
-
-       /**
-        * Get coordinate by hash
-        *
-        * @param string $hash
-        * @return Model\Constraint|Model\Location|bool
-        */
-       public function getCoordinateByHash($hash) {
-               $sessionData = $this->frontendUser->getKey('ses', 'tx_storefinder_coordinates');
-
-               $coordinate = isset($sessionData[$hash]) ? unserialize($sessionData[$hash]) : FALSE;
-
-               return $coordinate;
-       }
-
-       /**
-        * Add calculated coordinate for hash
-        *
-        * @param Model\Constraint|Model\Location $coordinate
-        * @param string $hash
-        * @return void
-        */
-       public function addCoordinateForHash($coordinate, $hash) {
-               $sessionData = $this->frontendUser->getKey('ses', 'tx_storefinder_coordinates');
-               $sessionData[$hash] = serialize($coordinate);
-
-               $this->frontendUser->setKey('ses', 'tx_storefinder_coordinates', $sessionData);
-               $this->frontendUser->storeSessionData();
-       }
-}
\ No newline at end of file
index 1b13e55..49b3398 100644 (file)
@@ -56,6 +56,8 @@ class TceMainHook {
         * @param string $id
         * @param array $fieldArray
         * @param \TYPO3\CMS\Core\DataHandling\DataHandler $parentObject
+        * @throws \InvalidArgumentException
+        * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
         * @return void
         */
        public function processDatamap_afterDatabaseOperations($status, $table, $id, $fieldArray, $parentObject) {
@@ -102,6 +104,7 @@ class TceMainHook {
         * Fetch location for uid
         *
         * @param integer $uid
+        * @throws \InvalidArgumentException
         * @return Location
         */
        protected function fetchLocation($uid) {
@@ -111,6 +114,9 @@ class TceMainHook {
        /**
         * Getter for repository
         *
+        * @throws \InvalidArgumentException
+        * @throws \TYPO3\CMS\Extbase\Object\Exception
+        * @throws \TYPO3\CMS\Extbase\Object\Exception\CannotBuildObjectException
         * @return \Evoweb\StoreFinder\Domain\Repository\LocationRepository
         */
        protected function getRepository() {
@@ -124,6 +130,7 @@ class TceMainHook {
        /**
         * Getter for object manager
         *
+        * @throws \InvalidArgumentException
         * @return \TYPO3\CMS\Extbase\Object\ObjectManager
         */
        protected function getObjectManager() {
@@ -139,6 +146,9 @@ class TceMainHook {
         * Sets coordinates by using geocoding service
         *
         * @param Location $location
+        * @throws \InvalidArgumentException
+        * @throws \TYPO3\CMS\Extbase\Object\Exception
+        * @throws \TYPO3\CMS\Extbase\Object\Exception\CannotBuildObjectException
         * @return Location
         */
        protected function setCoordinates(Location $location) {
@@ -151,6 +161,10 @@ class TceMainHook {
         * Stores location
         *
         * @param Location $location
+        * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
+        * @throws \InvalidArgumentException
+        * @throws \TYPO3\CMS\Extbase\Object\Exception
+        * @throws \TYPO3\CMS\Extbase\Object\Exception\CannotBuildObjectException
         * @return void
         */
        protected function storeLocation(Location $location) {
index 5b4585c..4e1f011 100644 (file)
@@ -38,6 +38,12 @@ class GeocodeService {
        protected $settings = array();
 
        /**
+        * @var \Evoweb\StoreFinder\Cache\CoordinatesCache
+        * @inject
+        */
+       protected $coordinatesCache;
+
+       /**
         * Constructor
         *
         * @param array $settings
@@ -65,23 +71,54 @@ class GeocodeService {
        }
 
        /**
+        * Geocode address and retries if first attempt or value in session
+        * is not geocoded
+        *
+        * @param Model\Constraint $address
+        * @param bool $forceGeocoding
+        * @return Model\Constraint
+        */
+       public function geocodeAddress($address, $forceGeocoding = FALSE) {
+               $geocodedAddress = $this->coordinatesCache->getCoordinateByAddress($address);
+               if ($forceGeocoding || !$geocodedAddress->isGeocoded()) {
+                       $fieldsHit = array();
+                       $geocodedAddress = $this->processAddress($address, $fieldsHit);
+                       $this->coordinatesCache->addCoordinateForAddress($geocodedAddress, $fieldsHit);
+               }
+
+               // In case the address without geocoded location was stored in
+               // session or the geocoding did not work a second try is done
+               if (!$forceGeocoding && !$geocodedAddress->isGeocoded()) {
+                       $geocodedAddress = $this->geocodeAddress($geocodedAddress, TRUE);
+               }
+
+               return $geocodedAddress;
+       }
+
+       /**
         * Geocode address
         *
         * @param Model\Location|Model\Constraint $location
+        * @param array &$fields
+        * @throws \RuntimeException
+        * @throws \UnexpectedValueException
         * @return mixed
         */
-       public function geocodeAddress($location) {
+       protected function processAddress($location, &$fields) {
                // Main Geocoder
-               $query = $this->prepareQuery($location, array('address', 'zipcode', 'city', 'state', 'country'));
-               $coordinate = $this->getCoordinateByQuery($query);
+               $fields = array('address', 'zipcode', 'city', 'state', 'country');
+               $queryValues = $this->prepareValuesForQuery($location, $fields);
+               $coordinate = $this->getCoordinateByApiCall($queryValues);
 
                // If there is no coordinat yet, we assume it's international and attempt
                // to find it based on just the city and country.
                if (!$coordinate->lat && !$coordinate->lng) {
-                       $query = $this->prepareQuery($location, array('city', 'country'));
-                       $coordinate = $this->getCoordinateByQuery($query);
+                       $fields = array('city', 'country');
+                       $queryValues = $this->prepareValuesForQuery($location, $fields);
+                       $coordinate = $this->getCoordinateByApiCall($queryValues);
                }
 
+               // We should have coordinates by now and add them to location
                if ($coordinate->lat && $coordinate->lng) {
                        $location->setLatitude($coordinate->lat);
                        $location->setLongitude($coordinate->lng);
@@ -95,11 +132,13 @@ class GeocodeService {
         *
         * @param Model\Location|Model\Constraint $location
         * @param array $fields
+        * @throws \RuntimeException
+        * @throws \UnexpectedValueException
         * @return array
         */
-       protected function prepareQuery($location, $fields) {
+       protected function prepareValuesForQuery($location, $fields) {
                        // for urlencoding
-               $query = array();
+               $queryValues = array();
                foreach ($fields as $field) {
                        $methodName = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $field)));
                        $value = $location->{$methodName}();
@@ -124,12 +163,13 @@ class GeocodeService {
 
                                default:
                        }
+
                        if (!empty($value) && !is_object($value) && !is_array($value)) {
-                               $query[$field] = urlencode($value);
+                               $queryValues[$field] = urlencode($value);
                        }
                }
 
-               return $query;
+               return $queryValues;
        }
 
        /**
@@ -138,7 +178,7 @@ class GeocodeService {
         * @param array $parameter
         * @return \stdClass
         */
-       protected function getCoordinateByQuery($parameter) {
+       protected function getCoordinateByApiCall($parameter) {
                $apiUrl = $this->settings['geocodeUrl'] . '&address=' . implode(',+', $parameter);
                $addressData = json_decode(utf8_encode(GeneralUtility::getURL($apiUrl)));
 
index 1f58147..36db808 100644 (file)
@@ -28,7 +28,8 @@ class UpdateUtility {
                        'sys_language_uid' => 'sys_language_uid',
                        'l10n_parent' => 'value:attributes:l10n_parent',
                        'l10n_diffsource' => 'l10n_diffsource',
-                       'icon' => 'icon',
+                       // icon get migrated at an extra step
+                       // 'icon' => 'icon',
                        'name' => 'name',
                ),
                'categories' => array(
@@ -68,7 +69,7 @@ class UpdateUtility {
                        'contactperson' => 'person',
                        'state' => 'state',
                        'zipcode' => 'zipcode',
-                               // @todo implement 1:1 references for country
+                       // @todo implement 1:1 references for country
                        'country' => 'ref:country',
                        'products' => 'products',
                        'email' => 'email',
@@ -78,10 +79,12 @@ class UpdateUtility {
                        'hours' => 'hours',
                        'url' => 'url',
                        'notes' => 'notes',
-                       'media' => 'media',
-                               // @todo implement fal references for images
-                       'imageurl' => 'ref:image',
-                       'icon' => 'icon',
+                       // media get migrated at an extra step
+                       // 'media' => 'media',
+                       // imageurl get migrated at an extra step
+                       // 'imageurl' => 'image',
+                       // icon get migrated at an extra step
+                       // 'icon' => 'icon',
                        'content' => 'content',
                        'use_coordinate' => '',
                        'categoryuid' => 'comma:mm:categories:sys_category_record_mm:uid_foreign:tx_storefinder_domain_model_location:categories',
@@ -95,6 +98,40 @@ class UpdateUtility {
        /**
         * @var array
         */
+       protected $fileMapping = array(
+               'attributes' => array(
+                       'icon' => array(
+                               'sourceField' => 'icon',
+                               'sourcePath' => 'uploads/tx_locator/icons/',
+                               'destinationField' => 'icon',
+                               'destinationTable' => 'tx_storefinder_domain_model_attribute',
+                       ),
+               ),
+               'locations' => array(
+                       'media' => array(
+                               'sourceField' => 'media',
+                               'sourcePath' => 'uploads/tx_locator/media/',
+                               'destinationField' => 'media',
+                               'destinationTable' => 'tx_storefinder_domain_model_location',
+                       ),
+                       'imageurl' => array(
+                               'sourceField' => 'imageurl',
+                               'sourcePath' => 'uploads/tx_locator/',
+                               'destinationField' => 'image',
+                               'destinationTable' => 'tx_storefinder_domain_model_location',
+                       ),
+                       'icon' => array(
+                               'sourceField' => 'icon',
+                               'sourcePath' => 'uploads/tx_locator/icons/',
+                               'destinationField' => 'icon',
+                               'destinationTable' => 'tx_storefinder_domain_model_location',
+                       ),
+               ),
+       );
+
+       /**
+        * @var array
+        */
        protected $records = array(
                'attributes' => array(),
                'categories' => array(),
@@ -108,6 +145,27 @@ class UpdateUtility {
 
 
        /**
+        * @var string
+        */
+       protected $targetDirectory;
+
+       /**
+        * @var \TYPO3\CMS\Core\Resource\ResourceFactory
+        */
+       protected $fileFactory;
+
+       /**
+        * @var \TYPO3\CMS\Core\Resource\Index\FileIndexRepository
+        */
+       protected $fileIndexRepository;
+
+       /**
+        * @var \TYPO3\CMS\Core\Resource\ResourceStorage
+        */
+       protected $storage;
+
+
+       /**
         * Performes the Updates
         * Outputs HTML Content
         *
@@ -120,6 +178,9 @@ class UpdateUtility {
 
                if ($this->access()) {
                        if ($this->warningAccepted()) {
+                               $this->initializeFalStorage();
+                               $this->checkPrerequisites();
+
                                $this->migrateAttributes();
                                $this->migrateCategories();
                                $this->migrateLocations();
@@ -207,6 +268,8 @@ class UpdateUtility {
                                $this->database->exec_INSERTquery($table, $attribute);
                                $this->records['attributes'][$row['uid']] = $attribute['uid'] = $this->database->sql_insert_id();
                        }
+
+                       $this->migrateFilesToFal($row, $attribute, $this->fileMapping['attributes']['icon']);
                }
 
                $this->messageArray[] = array('message' => count($this->records['attributes']) . ' attributes migrated');
@@ -259,6 +322,10 @@ class UpdateUtility {
                        }
 
                        $this->mapFieldsPostImport($row, $location, 'locations');
+
+                       $this->migrateFilesToFal($row, $location, $this->fileMapping['locations']['media']);
+                       $this->migrateFilesToFal($row, $location, $this->fileMapping['locations']['imageurl']);
+                       $this->migrateFilesToFal($row, $location, $this->fileMapping['locations']['icon']);
                }
 
                $this->database->sql_query('
@@ -523,6 +590,102 @@ class UpdateUtility {
                );
        }
 
+
+       /**
+        * Prepare FAL storage for migration
+        *
+        * @throws \RuntimeException
+        * @return void
+        */
+       protected function initializeFalStorage() {
+               if (!$this->storage) {
+                       $fileadminDirectory = rtrim($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], '/') . '/';
+
+                       /** @var $storageRepository \TYPO3\CMS\Core\Resource\StorageRepository */
+                       $storageRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\StorageRepository');
+                       $storages = $storageRepository->findAll();
+
+                       foreach ($storages as $storage) {
+                               $storageRecord = $storage->getStorageRecord();
+                               $configuration = $storage->getConfiguration();
+                               $isLocalDriver = $storageRecord['driver'] === 'Local';
+                               $isOnFileadmin = !empty($configuration['basePath']) && \TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr($configuration['basePath'], $fileadminDirectory);
+                               if ($isLocalDriver && $isOnFileadmin) {
+                                       $this->storage = $storage;
+                                       break;
+                               }
+                       }
+
+                       if (!isset($this->storage)) {
+                               throw new \RuntimeException('Local default storage could not be initialized - might be due to missing sys_file* tables.');
+                       }
+
+                       $this->fileFactory = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
+                       $this->fileIndexRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Index\\FileIndexRepository');
+                       $this->targetDirectory = PATH_site . $fileadminDirectory . \TYPO3\CMS\Install\Updates\TtContentUploadsUpdateWizard::FOLDER_ContentUploads . '/';
+               }
+       }
+
+       /**
+        * Ensures a new folder "fileadmin/content_upload/" is available.
+        *
+        * @return void
+        */
+       protected function checkPrerequisites() {
+               if (!$this->storage->hasFolder(\TYPO3\CMS\Install\Updates\TtContentUploadsUpdateWizard::FOLDER_ContentUploads)) {
+                       $this->storage->createFolder(\TYPO3\CMS\Install\Updates\TtContentUploadsUpdateWizard::FOLDER_ContentUploads, $this->storage->getRootLevelFolder());
+               }
+       }
+
+       /**
+        * Processes the actual transformation from CSV to sys_file_references
+        *
+        * @param array $source
+        * @param array $destination
+        * @param array $configuration
+        * @return void
+        */
+       protected function migrateFilesToFal(array $source, array $destination, array $configuration) {
+               $path = PATH_site . $configuration['sourcePath'];
+               $files = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $source[$configuration['sourceField']], TRUE);
+
+               $i = 1;
+               foreach ($files as $file) {
+                       if (file_exists($path . $file)) {
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::upload_copy_move($path . $file, $this->targetDirectory . $file);
+                               /** @var \TYPO3\CMS\Core\Resource\File $fileObject */
+                               $fileObject = $this->storage->getFile(\TYPO3\CMS\Install\Updates\TtContentUploadsUpdateWizard::FOLDER_ContentUploads . '/' . $file);
+                               $this->fileIndexRepository->add($fileObject);
+
+                               $count = $this->database->exec_SELECTcountRows(
+                                       '*',
+                                       'sys_file_reference',
+                                       'tablenames = ' . $this->database->fullQuoteStr($configuration['destinationTable'], 'sys_file_reference') .
+                                       ' AND fieldname = ' . $this->database->fullQuoteStr($configuration['destinationField'], 'sys_file_reference') .
+                                       ' AND uid_local = ' . $fileObject->getUid() .
+                                       ' AND uid_foreign = ' . $destination['uid']
+                               );
+
+                               if (!$count) {
+                                       $dataArray = array(
+                                               'uid_local' => $fileObject->getUid(),
+                                               'tablenames' => $configuration['destinationTable'],
+                                               'uid_foreign' => $destination['uid'],
+                                               // the sys_file_reference record should always placed on the same page
+                                               // as the record to link to, see issue #46497
+                                               'pid' => $source['pid'],
+                                               'fieldname' => $configuration['destinationField'],
+                                               'sorting_foreign' => $i,
+                                               'table_local' => 'sys_file'
+                                       );
+                                       $this->database->exec_INSERTquery('sys_file_reference', $dataArray);
+                               }
+                       }
+                       $i++;
+               }
+       }
+
+
        /**
         * echeck if the Ipdate is neassessary
         *
diff --git a/Classes/Validation/Validator/ConstraintValidator.php b/Classes/Validation/Validator/ConstraintValidator.php
new file mode 100644 (file)
index 0000000..8b550ef
--- /dev/null
@@ -0,0 +1,271 @@
+<?php
+namespace Evoweb\StoreFinder\Validation\Validator;
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2014 Sebastian Fischer <typo3@evoweb.de>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * A Uservalidator
+ */
+class ConstraintValidator extends \TYPO3\CMS\Extbase\Validation\Validator\GenericObjectValidator implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {
+
+       /**
+        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+        */
+       static protected $instancesCurrentlyUnderValidation;
+
+       /**
+        * Object manager
+        *
+        * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
+        */
+       protected $objectManager;
+
+       /**
+        * Configuration manager
+        *
+        * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
+        */
+       protected $configurationManager;
+
+       /**
+        * Settings
+        *
+        * @var array
+        */
+       protected $settings = NULL;
+
+       /**
+        * Configuration of the framework
+        *
+        * @var array
+        */
+       protected $frameworkConfiguration = array();
+
+       /**
+        * @var \TYPO3\CMS\Extbase\Error\Result
+        * @inject
+        */
+       protected $result;
+
+       /**
+        * Validator resolver
+        *
+        * @var \Evoweb\StoreFinder\Validation\ValidatorResolver
+        * @inject
+        */
+       protected $validatorResolver;
+
+       /**
+        * Name of the current field to validate
+        *
+        * @var string
+        */
+       protected $currentPropertyName = '';
+
+       /**
+        * Options for the current validation
+        *
+        * @var array
+        */
+       protected $currentValidatorOptions = array();
+
+       /**
+        * Model that gets validated currently
+        *
+        * @var object
+        */
+       protected $model;
+
+
+       /**
+        * Inject of configuration manager
+        *
+        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManager $configurationManager
+        * @return void
+        */
+       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManager $configurationManager) {
+               $this->configurationManager = $configurationManager;
+               $this->settings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS);
+               $this->frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
+       }
+
+       /**
+        * Validate object
+        *
+        * @param mixed $object
+        * @throws \TYPO3\CMS\Extbase\Reflection\Exception\PropertyNotAccessibleException
+        * @throws \InvalidArgumentException
+        * @return boolean|\TYPO3\CMS\Extbase\Error\Result
+        */
+       public function validate($object) {
+               $messages = new \TYPO3\CMS\Extbase\Error\Result();
+               if (self::$instancesCurrentlyUnderValidation === NULL) {
+                       self::$instancesCurrentlyUnderValidation = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
+               }
+               if ($object === NULL) {
+                       return $messages;
+               }
+               if (!$this->canValidate($object)) {
+                       $messages->addError(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('error_notvalidatable', 'StoreFinder'), 1301599551);
+                       return $messages;
+               }
+               if (self::$instancesCurrentlyUnderValidation->contains($object)) {
+                       return $messages;
+               } else {
+                       self::$instancesCurrentlyUnderValidation->attach($object);
+               }
+
+               $this->model = $object;
+
+               $propertyValidators = $this->getValidationRulesFromSettings();
+               foreach ($propertyValidators as $propertyName => $validatorsNames) {
+                       if (!property_exists($object, $propertyName)) {
+                               $messages->addError(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('error_notexists', 'StoreFinder'), 1301599575);
+                       } else {
+                               $this->currentPropertyName = $propertyName;
+                               $propertyValue = $this->getPropertyValue($object, $propertyName);
+                               $this->checkProperty($propertyValue, (array) $validatorsNames, $messages->forProperty($propertyName));
+                       }
+               }
+
+               self::$instancesCurrentlyUnderValidation->detach($object);
+               return $messages;
+       }
+
+       /**
+        * Checks if the specified property of the given object is valid, and adds
+        * found errors to the $messages object.
+        *
+        * @param mixed $value The value to be validated
+        * @param array $validatorNames Contains an array with validator names
+        * @param \TYPO3\CMS\Extbase\Error\Result $messages the result object to
+        *              which the validation errors should be added
+        * @return void
+        */
+       protected function checkProperty($value, $validatorNames, \TYPO3\CMS\Extbase\Error\Result $messages) {
+               foreach ($validatorNames as $validatorName) {
+                       $messages->merge($this->getValidator($validatorName)->validate($value));
+               }
+       }
+
+       /**
+        * Check if validator can validate object
+        *
+        * @param object $object
+        * @return boolean
+        */
+       public function canValidate($object) {
+               return ($object instanceof \Evoweb\StoreFinder\Domain\Model\Constraint);
+       }
+
+       /**
+        * Get validation rules from settings
+        *
+        * @return array
+        */
+       protected function getValidationRulesFromSettings() {
+               return $this->settings['validation'];
+       }
+
+       /**
+        * Parse the rule and instanciate an validator with the name and the options
+        *
+        * @param string $rule
+        * @throws \InvalidArgumentException
+        * @return \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
+        */
+       protected function getValidator($rule) {
+               $currentValidator = $this->parseRule($rule);
+               $this->currentValidatorOptions = (array) $currentValidator['validatorOptions'];
+
+               /** @var $validatorObject \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator */
+               $validatorObject = $this->validatorResolver->createValidator($currentValidator['validatorName'], $this->currentValidatorOptions);
+
+               if (method_exists($validatorObject, 'setModel')) {
+                       /** @noinspection PhpUndefinedMethodInspection */
+                       $validatorObject->setModel($this->model);
+               }
+               if (method_exists($validatorObject, 'setPropertyName')) {
+                       /** @noinspection PhpUndefinedMethodInspection */
+                       $validatorObject->setPropertyName($this->currentPropertyName);
+               }
+
+               return $validatorObject;
+       }
+
+       /**
+        * Parse rule
+        *
+        * @param string $rule
+        * @return array
+        */
+       protected function parseRule($rule) {
+               $parsedRules = $this->validatorResolver->getParsedValidatorAnnotation($rule);
+
+               return current($parsedRules['validators']);
+       }
+
+       /**
+        * Merge error into local errors
+        *
+        * @param array $errors
+        * @return void
+        */
+       protected function ___mergeErrors($errors) {
+               /** @var $error \TYPO3\CMS\Extbase\Validation\Error */
+               foreach ($errors as $error) {
+                       $localizedFieldName = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($this->currentPropertyName, 'SfRegister');
+
+                       $errorMessage = $error->getMessage();
+                       $localizedErrorCode = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('error_' . $error->getCode(), 'SfRegister');
+                       $localizedErrorMessage = $localizedErrorCode ? $localizedErrorCode : $errorMessage;
+
+                       $markers = array_merge((array) $localizedFieldName, $this->currentValidatorOptions);
+                       $messageWithReplacedMarkers = vsprintf($localizedErrorMessage, $markers);
+
+                       $this->___addErrorForProperty($this->currentPropertyName, $messageWithReplacedMarkers, $error->getCode());
+               }
+       }
+
+       /**
+        * Add an error with message and code to the property errors
+        *
+        * @param string $propertyName name of the property to add the error to
+        * @param string $message Message to be shwon
+        * @param string $code Error code to identify the error
+        * @return void
+        */
+       protected function ___addErrorForProperty($propertyName, $message, $code) {
+               if (!$this->result->forProperty($propertyName)->hasErrors()) {
+                       /** @var $error \TYPO3\CMS\Extbase\Validation\PropertyError */
+                       $error = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Validation\\PropertyError', $propertyName);
+                       $error->addErrors(array(
+                               $this->objectManager->get('TYPO3\CMS\\Extbase\\Validation\\Error', $message, $code)
+                       ));
+                       $this->result->addError($error);
+               }
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Validation/Validator/RequiredValidator.php b/Classes/Validation/Validator/RequiredValidator.php
new file mode 100644 (file)
index 0000000..75726a9
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+namespace Evoweb\StoreFinder\Validation\Validator;
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2014 Sebastian Fischer <typo3@evoweb.de>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * A required validator to check that a value is set
+ *
+ * @scope singleton
+ */
+class RequiredValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {
+       /**
+        * Override to be able to validate empty values
+        *
+        * @param mixed $value The value that should be validated
+        * @return \TYPO3\CMS\Extbase\Error\Result
+        */
+       public function validate($value) {
+               $this->result = new \TYPO3\CMS\Extbase\Error\Result();
+               $this->isValid($value);
+               return $this->result;
+       }
+
+       /**
+        * If the given value is empty
+        *
+        * @param string $value The value
+        * @return boolean
+        */
+       public function isValid($value) {
+               $result = TRUE;
+
+               if (empty($value)) {
+                       $this->addError(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('error_required', 'StoreFinder'), 1305008423);
+                       $result = FALSE;
+               }
+
+               return $result;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Validation/ValidatorResolver.php b/Classes/Validation/ValidatorResolver.php
new file mode 100644 (file)
index 0000000..09d1c36
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+namespace Evoweb\StoreFinder\Validation;
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2014 Sebastian Fischer <typo3@evoweb.de>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Validator resolver to automatically find a validator for a given subject
+ */
+class ValidatorResolver extends \TYPO3\CMS\Extbase\Validation\ValidatorResolver {
+       /**
+        * Get the parsed options given in @validate annotations.
+        *
+        * @param string $validateValue
+        * @return array
+        */
+       public function getParsedValidatorAnnotation($validateValue) {
+               return $this->parseValidatorAnnotation($validateValue);
+       }
+}
+
+?>
\ No newline at end of file
index f4869d8..2b95621 100644 (file)
                                                </TCEforms>
                                        </settings.showAfterSearch>
 
-                                       <settings.showStoreImage>
-                                               <TCEforms>
-                                                       <label>LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xml:pi_flexform.showStoreImage</label>
-                                                       <config>
-                                                               <type>check</type>
-                                                               <default>1</default>
-                                                       </config>
-                                               </TCEforms>
-                                       </settings.showStoreImage>
-
                                        <settings.mapConfiguration.apiV3Layers>
                                                <TCEforms>
                                                        <label>LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xml:pi_flexform.apiV3Layers</label>
                                                        </config>
                                                </TCEforms>
                                        </view.partialRootPath>
+
+                                       <settings.showStoreImage>
+                                               <TCEforms>
+                                                       <label>LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xml:pi_flexform.showStoreImage</label>
+                                                       <config>
+                                                               <type>check</type>
+                                                               <default>1</default>
+                                                       </config>
+                                               </TCEforms>
+                                       </settings.showStoreImage>
                                </el>
                        </ROOT>
                </sheetDisplayOptions>
                                                </TCEforms>
                                        </settings.categoryPriority>
 
-                                       <settings.resultPageId>
+                                       <settings.singleLocationId>
                                                <TCEforms>
-                                                       <label>LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xml:pi_flexform.resultPageId</label>
+                                                       <label>LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xml:pi_flexform.singleLocationId</label>
                                                        <config>
                                                                <type>group</type>
                                                                <internal_type>db</internal_type>
-                                                               <allowed>pages</allowed>
+                                                               <allowed>tx_storefinder_domain_model_location</allowed>
                                                                <size>1</size>
                                                                <maxitems>1</maxitems>
                                                                <minitems>0</minitems>
                                                                <show_thumbs>0</show_thumbs>
                                                        </config>
                                                </TCEforms>
-                                       </settings.resultPageId>
+                                       </settings.singleLocationId>
 
-                                       <settings.routePageId>
+                                       <settings.resultPageId>
                                                <TCEforms>
-                                                       <label>LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xml:pi_flexform.routePageId</label>
+                                                       <label>LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xml:pi_flexform.resultPageId</label>
                                                        <config>
                                                                <type>group</type>
                                                                <internal_type>db</internal_type>
                                                                <show_thumbs>0</show_thumbs>
                                                        </config>
                                                </TCEforms>
-                                       </settings.routePageId>
+                                       </settings.resultPageId>
 
-                                       <settings.singleLocationId>
+                                       <settings.routePageId>
                                                <TCEforms>
-                                                       <label>LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xml:pi_flexform.singleLocationId</label>
+                                                       <label>LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xml:pi_flexform.routePageId</label>
                                                        <config>
                                                                <type>group</type>
                                                                <internal_type>db</internal_type>
-                                                               <allowed>tx_storefinder_domain_model_location</allowed>
+                                                               <allowed>pages</allowed>
                                                                <size>1</size>
                                                                <maxitems>1</maxitems>
                                                                <minitems>0</minitems>
                                                                <show_thumbs>0</show_thumbs>
                                                        </config>
                                                </TCEforms>
-                                       </settings.singleLocationId>
+                                       </settings.routePageId>
                                </el>
                        </ROOT>
                </sheetReferenceOptions>
index 5c48c2a..f4706ce 100644 (file)
@@ -74,17 +74,47 @@ return array(
                'icon' => array(
                        'exclude' => 0,
                        'label' => 'LLL:EXT:store_finder/Resources/Private/Language/locallang_db.xml:tx_storefinder_domain_model_attribute.icon',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'file',
-                               'allowed' => 'gif,png,jpeg,jpg',
-                               'max_size' => 500,
-                               'uploadfolder' => 'uploads/tx_storefinder',
-                               'show_thumbs' => 1,
-                               'size' => 1,
+                       'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('icon', array(
+                               'appearance' => array(
+                                       'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference'
+                               ),
                                'minitems' => 0,
                                'maxitems' => 1,
-                       )
+                               // custom configuration for displaying fields in the overlay/reference table
+                               // to use the imageoverlayPalette instead of the basicoverlayPalette
+                               'foreign_types' => array(
+                                       '0' => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       )
+                               )
+                       ), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']),
                ),
        ),
 
index 8f0c5d6..d62d147 100644 (file)
@@ -292,12 +292,47 @@ return array(
                'icon' => array(
                        'exclude' => 0,
                        'label' => 'LLL:EXT:store_finder/Resources/Private/Language/locallang_db.xml:tx_storefinder_domain_model_location.icon',
-                       'config' => array(
-                               'type' => 'select',
-                               'items' => array(),
-                               'size' => 1,
+                       'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('icon', array(
+                               'appearance' => array(
+                                       'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference'
+                               ),
+                               'minitems' => 0,
                                'maxitems' => 1,
-                       )
+                               // custom configuration for displaying fields in the overlay/reference table
+                               // to use the imageoverlayPalette instead of the basicoverlayPalette
+                               'foreign_types' => array(
+                                       '0' => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       )
+                               )
+                       ), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']),
                ),
 
                'latitude' => array(
@@ -383,8 +418,101 @@ return array(
                        )
                ),
 
-               'image' => $GLOBALS['TCA']['tt_content']['columns']['image'],
-               'media' => $GLOBALS['TCA']['tt_content']['columns']['media'],
+               'image' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:store_finder/Resources/Private/Language/locallang_db.xml:tx_storefinder_domain_model_location.image',
+                       'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('image', array(
+                               'appearance' => array(
+                                       'headerThumbnail' => array(
+                                               'width' => '100',
+                                               'height' => '100c',
+                                       ),
+                                       'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference'
+                               ),
+                               // custom configuration for displaying fields in the overlay/reference table
+                               // to use the imageoverlayPalette instead of the basicoverlayPalette
+                               'foreign_types' => array(
+                                       '0' => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       )
+                               )
+                       ), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']),
+               ),
+
+               'media' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:store_finder/Resources/Private/Language/locallang_db.xml:tx_storefinder_domain_model_location.media',
+                       'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('media', array(
+                               'appearance' => array(
+                                       'headerThumbnail' => array(
+                                               'width' => '100',
+                                               'height' => '100c',
+                                       ),
+                                       'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference'
+                               ),
+                               // custom configuration for displaying fields in the overlay/reference table
+                               // to use the imageoverlayPalette instead of the basicoverlayPalette
+                               'foreign_types' => array(
+                                       '0' => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       ),
+                                       \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette'
+                                       )
+                               )
+                       ), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']),
+               ),
 
                'content' => array(
                        'exclude' => 1,
index 21244b3..547cb71 100644 (file)
@@ -9,7 +9,7 @@ plugin.tx_storefinder.settings {
        mapConfiguration {
                # traffic, weather, bicycling,  panoramio, kml
                apiV3Layers =
-               language = de
+               language = en
                allowSensore = 1
        }
 
@@ -17,6 +17,12 @@ plugin.tx_storefinder.settings {
                height = 400
                width = 600
        }
+
+       validation {
+               zipcode = Evoweb\StoreFinder\Validation\Validator\RequiredValidator
+               city = Evoweb\StoreFinder\Validation\Validator\RequiredValidator
+               country = Evoweb\StoreFinder\Validation\Validator\RequiredValidator
+       }
 }
 
 config.tx_extbase.persistence {
diff --git a/Documentation/Administration/Index.rst b/Documentation/Administration/Index.rst
new file mode 100644 (file)
index 0000000..77ca45e
--- /dev/null
@@ -0,0 +1,38 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: ../Includes.txt
+
+.. _administration:
+
+Administration
+--------------
+
+The part for administrator is fairly simple. Just go to the extension manager,
+switch to "Get extensions" and enter "store_finder" in the search field on top.
+Install the extensions and you are done for a new installation.
+
+If you use a different google maps key, like for a business accont, you need to
+configure the extension in the em. Just hit the gear on the line of the
+installed store_finder and enter the api console key in the designated field.
+
+In case the google maps geocode url changes and the extension has no update for,
+that the url can be changed in the same configuration part. Just enter the url
+in the field Url used for geocode.
+
+Configuration:
+~~~~~~~~~~~~~~
+
+.. figure:: ../Images/admin_config.png
+   :alt: Search form
+   :align: left
+
+Migrate from locator:
+---------------------
+
+The extension supports an update script that is able to migrate locator records
+to the own tables. If the update scripts gets executed the start migration button
+needs to be pushed. Afterwards there are migrated records in every folder that
+contained the locator records previously.
\ No newline at end of file
diff --git a/Documentation/Configuration/Index.rst b/Documentation/Configuration/Index.rst
new file mode 100644 (file)
index 0000000..c6ac3a0
--- /dev/null
@@ -0,0 +1,84 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: ../Includes.txt
+
+.. _configuration:
+
+Configuration
+=============
+
+.. contents::
+   :local:
+   :depth: 1
+
+
+plugin.tx_storefinder.settings
+------------------------------
+
+.. container:: ts-properties
+
+  ===================================================== ================================================= ========== ========== ========== ==========
+  Property                                              Data types                                        TypoScript Flexform   stdWrap    Default
+  ===================================================== ================================================= ========== ========== ========== ==========
+  showBeforeSearch_                                     :ref:`data-type-integer`                          yes        yes        no         0
+  showAfterSearch_                                      :ref:`data-type-boolean`                          yes        yes        no         0
+  mapConfiguration-apiV3Layers_                         :ref:`data-type-boolean`                          yes        yes        no         0
+  notifyAdminPostCreateAccept_                          :ref:`data-type-boolean`                                                no         0
+  notifyAdminPostCreateDecline_                         :ref:`data-type-boolean`                                                no         0
+  acceptEmailPostCreate_                                :ref:`data-type-boolean`                                                no         0
+  ===================================================== ================================================= ========== ========== ========== ==========
+
+
+.. _showBeforeSearch:
+.. ### BEGIN~OF~TABLE ###
+
+.. container:: table-row
+
+   Property
+         showBeforeSearch
+
+   Data type
+         integer
+
+   Description
+         Defines what should get displayed before the search was triggered
+
+   Default
+         1
+
+   Possible values:
+         1,2,4
+
+
+// @todo write config doku
+plugin.tx_storefinder.settings
+       showAfterSearch ts ff-6(1,2,4)
+       mapConfiguration.apiV3Layers ts ff-(traffic,weather,bicycling,panoramio,kml)
+       allowedCountries ts ff-(iso2)
+       categories ts ff
+       categoryPriority ts ff-(useAsFilterInFrontend,useParentIfNoFilterSelected,limitResultsToCategories)
+       singleLocationId ts ff
+       -
+       geocodeUrl ts-http://maps.googleapis.com/maps/api/geocode/json?sensor=false for search geocoding / em settings for location geocoding
+       limit ts 20
+       distanceUnit ts-(miles,kilometer)
+       mapConfiguration.language ts en
+       mapConfiguration.allowSensore ts 1
+       -
+       showStoreImage ts ff-1(1)
+       resultPageId ts ff
+       routePageId ts ff
+       mapSize.height ts 600
+       mapSize.width ts 400
+       validation ts
+       override ts
+
+plugin.tx_storefinder.view
+       templateRootPath ts ff
+       partialRootPath ts ff
+
+plugin.tx_storefinder.persistence
+       storagePid ts / Record Storage Page in plugin
\ No newline at end of file
diff --git a/Documentation/Images/admin_config.png b/Documentation/Images/admin_config.png
new file mode 100644 (file)
index 0000000..6ab94d5
Binary files /dev/null and b/Documentation/Images/admin_config.png differ
diff --git a/Documentation/Images/introduction_result.png b/Documentation/Images/introduction_result.png
new file mode 100644 (file)
index 0000000..7c00c98
Binary files /dev/null and b/Documentation/Images/introduction_result.png differ
diff --git a/Documentation/Images/introduction_search.png b/Documentation/Images/introduction_search.png
new file mode 100644 (file)
index 0000000..a5a2951
Binary files /dev/null and b/Documentation/Images/introduction_search.png differ
diff --git a/Documentation/Includes.txt b/Documentation/Includes.txt
new file mode 100644 (file)
index 0000000..0f651c6
--- /dev/null
@@ -0,0 +1,23 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. This is 'Includes.txt'. It is included at the very top of each and
+   every ReST source file in this documentation project (= manual).
+
+
+.. ==================================================
+.. DEFINE SOME TEXTROLES
+.. --------------------------------------------------
+
+.. role::   typoscript(code)
+
+.. role::   ts(typoscript)
+   :class:  typoscript
+
+.. role::   php(code)
+
+.. highlight:: typoscript
+
+.. highlight:: php
\ No newline at end of file
diff --git a/Documentation/Index.rst b/Documentation/Index.rst
new file mode 100644 (file)
index 0000000..649f7dc
--- /dev/null
@@ -0,0 +1,64 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: Includes.txt
+
+
+.. _start:
+
+============
+Store finder
+============
+
+:Extension Key:
+       store_finder
+
+:Language:
+       en
+
+:Description:
+       Search for stores based on local address with coordinates compiled with google maps api.
+
+:Keywords:
+       forEditors, forAdmins
+
+:Copyright:
+       2014
+
+:Author:
+       Sebastian Fischer
+
+:Email:
+       typo3@evoweb.de
+
+:License:
+       Open Content License available from `www.opencontent.org/opl.shtml`_.
+
+       .. _www.opencontent.org/opl.shtml: http://www.opencontent.org/opl.shtml
+
+:Rendered:
+       |today|
+
+The content of this document is related to TYPO3,
+
+a GNU/GPL CMS/Framework available from `www.typo3.org`_.
+
+.. _www.typo3.org: http://www.typo3.org/
+
+
+**Table of Contents**
+
+.. toctree::
+       :maxdepth: 5
+       :titlesonly:
+       :glob:
+
+       Introduction/Index
+       UserManual/Index
+       Administration/Index
+       Configuration/Index
+       Templating/Index
+       Tutorial/Index
+       Targets
diff --git a/Documentation/Introduction/Index.rst b/Documentation/Introduction/Index.rst
new file mode 100644 (file)
index 0000000..3f2d8ee
--- /dev/null
@@ -0,0 +1,60 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: ../Includes.txt
+
+.. _introduction:
+
+Introduction
+------------
+
+Search with result map and list
+_______________________________
+
+Purpose of this extension is, to have a search for locations based on
+an entered or configured address. The result displays a google map with
+marker for each location and a list of all locations. On click on a
+marker an info window with additional informations get shown.
+
+Search form:
+~~~~~~~~~~~~
+
+.. figure:: ../Images/introduction_search.png
+   :alt: Search form
+   :width: 711px
+   :align: left
+
+
+Result map and list:
+~~~~~~~~~~~~~~~~~~~~
+
+.. figure:: ../Images/introduction_result.png
+   :alt: Result map and list
+   :width: 711px
+   :align: left
+
+Single points of interest
+_________________________
+
+Its also possible to pre define a single location to display it on the
+map without search form. This is useful to have map with single point
+of interesst.
+For developer its also possible to use the plugin in their extension
+as map renderer for the location.
+
+How geolocations are computed
+_____________________________
+
+Every location gets geocoded with help of google maps api after saving
+the record in backend. By this its important to know, that the google
+maps website needs to be reached from the webserver.
+
+The coordinates are stored in the record each time when the record
+gets saved. If at one point the address gets changed the coordinate
+gets fetched from the api again.
+
+Search queries get geocoded the same way by the google maps api. To
+reduce the api requests the coordinates get stored in the session.
+So if a query gets send another time the api do not get requested again.
\ No newline at end of file
diff --git a/Documentation/Settings.yml b/Documentation/Settings.yml
new file mode 100644 (file)
index 0000000..5664de5
--- /dev/null
@@ -0,0 +1,11 @@
+# This is the project specific Settings.yml file.
+# Place Sphinx specific build information here.
+# Settings given here will replace the settings of 'conf.py'.
+
+---
+conf.py:
+  project: store_finder
+  copyright: 2010-2013
+  version: 1.0
+  release: 1.0.1
+...
\ No newline at end of file
diff --git a/Documentation/Targets.rst b/Documentation/Targets.rst
new file mode 100644 (file)
index 0000000..ef80e44
--- /dev/null
@@ -0,0 +1,11 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: Includes.txt
+
+Index: Labels for Crossreferencing
+==================================
+
+.. ref-targets-list::
\ No newline at end of file
diff --git a/Documentation/Templating/Index.rst b/Documentation/Templating/Index.rst
new file mode 100644 (file)
index 0000000..cdd3d48
--- /dev/null
@@ -0,0 +1,115 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: ../Includes.txt
+
+.. _templating:
+
+Templating
+----------
+
+Templates, partials and layouts
+_______________________________
+
+Like every other extbase extension its possible to configure the fluid
+templates, partials and layout path via typoscript. Beside that is also
+possible to configure the templates and partials path in the plugin.
+
+Example:
+========
+
+::
+
+    plugin.tx_storefinder.view {
+        templateRootPath =
+        partialRootPath =
+        layoutRootPath =
+    }
+
+Viewhelper
+__________
+
+Beside the default viewhelpers of fluid the extension comes with three
+additional viewhelpers. These are used to render the search like the
+form.selectCountries viewhelper, the map like the minify viewhelper and
+select what to render based on the configuration like the
+format.binaryAnd viewhelper.
+
+They are used by including the namespace in the file in which the
+viewhelper get used.
+
+Register Namespace:
+===================
+
+::
+
+    {namespace sf=Evoweb\StoreFinder\ViewHelpers}
+
+minify Viewhelper
+_________________
+
+This viewhelper gets used to minify the rendered json of the locations
+in the result map. The purpose is to reduce the traffic and clean the
+source code.
+So in stead of making the template unreadable the output gets minified
+on rendering time.
+
+Example viewhelper:
+===================
+
+::
+
+    var mapConfiguration = {<sf:minify>active: true,
+            <f:for each="{settings.mapConfiguration}" as="configuration" key="name" iteration="loop">{name}: '{configuration}',</f:for>
+        center: {
+            lat: <f:format.number decimals="7">{center.latitude}</f:format.number>,
+            lng: <f:format.number decimals="7">{center.longitude}</f:format.number>
+        },
+        zoom: '{center.zoom}'
+    </sf:minify>};
+
+Example output:
+===============
+
+::
+
+    var mapConfiguration = {active:true,apiV3Layers:'',language:'de',allowSensore:'1',center:{lat:50.1125089,lng:8.6521548},zoom:'11'}
+
+format.binaryAnd Viewhelper
+___________________________
+
+To be able to select which partial should be rendered its necessary to
+compare with binary and if the part is check in the plugin. As the f:if
+viewhelper is not able to do so, a special viewhelper is needed for that.
+
+Basicly what this means is, that the setting value, in this case
+showBeforeSearch, is formated with a logical and for comparison like in
+the example below. Here we check if the list should be rendered because
+in the plugin the binary value 4 stands for list.
+
+Example viewhelper:
+===================
+
+::
+
+    <f:if condition="{sf:format.binaryAnd(base: 4, content: settings.showBeforeSearch)} == 4">...</f:if>
+
+
+form.selectCounrtries
+_____________________
+
+The countries select viewhelper fetches the countries from
+static_info_tables and renders each country as option. All attributes from
+the fluid standard form.select are supported. Beside that if the optional
+attribute allowedCountries is set, only countries matching it get rendered.
+allowedCountries accepts a comma seperated list of ISO2 country codes.
+
+Example viewhelper:
+===================
+
+::
+
+    <sf:form.selectCountries property="country" id="sfrCountry" optionValueField="isoCodeA3" allowedCountries="{0: 'DE', 1: 'AT'}" />
+
diff --git a/Documentation/Tutorial/Index.rst b/Documentation/Tutorial/Index.rst
new file mode 100644 (file)
index 0000000..4b8c434
--- /dev/null
@@ -0,0 +1,21 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: ../Includes.txt
+
+.. _conditions:
+
+Tutorial
+--------
+
+// @todo write tutorial
+installation
+add typoscript
+add folder
+add page
+add plugin
+select storage page
+copy partials to fileadmin/admin
+set settings for partials
\ No newline at end of file
diff --git a/Documentation/UserManual/Index.rst b/Documentation/UserManual/Index.rst
new file mode 100644 (file)
index 0000000..bdd242f
--- /dev/null
@@ -0,0 +1,18 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: ../Includes.txt
+
+.. _conditions:
+
+User Manual
+-----------
+
+The simple version would consists of a folder for the locations records,
+a page for the plugin and the plugin it self. In this plugin the folder
+needs to be selected in tab behaviour field record storage page.
+
+If the usage of categories is unnecessary the configuration is done at
+this point.
\ No newline at end of file
diff --git a/Documentation/_make/Makefile b/Documentation/_make/Makefile
new file mode 100644 (file)
index 0000000..f469d33
--- /dev/null
@@ -0,0 +1,150 @@
+# You can set these variables from the command line.
+SPHINXOPTS    = -c . -a -E -w ./_not_versioned/warnings.txt
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ..
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS)  ..
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+       @echo "Please use \`make <target>' where <target> is one of"
+       @echo "  html       to make standalone HTML files"
+       @echo "  dirhtml    to make HTML files named index.html in directories"
+       @echo "  singlehtml to make a single large HTML file"
+       @echo "  pickle     to make pickle files"
+       @echo "  json       to make JSON files"
+       @echo "  htmlhelp   to make HTML files and a HTML help project"
+       @echo "  qthelp     to make HTML files and a qthelp project"
+       @echo "  devhelp    to make HTML files and a Devhelp project"
+       @echo "  epub       to make an epub"
+       @echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+       @echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+       @echo "  text       to make text files"
+       @echo "  man        to make manual pages"
+       @echo "  texinfo    to make Texinfo files"
+       @echo "  info       to make Texinfo files and run them through makeinfo"
+       @echo "  gettext    to make PO message catalogs"
+       @echo "  changes    to make an overview of all changed/added/deprecated items"
+       @echo "  linkcheck  to check all external links for integrity"
+       @echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+       -rm -rf $(BUILDDIR)/*
+
+html:
+       $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+       @echo
+       @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+       $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+       @echo
+       @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+       $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+       @echo
+       @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+       $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+       @echo
+       @echo "Build finished; now you can process the pickle files."
+
+json:
+       $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+       @echo
+       @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+       $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+       @echo
+       @echo "Build finished; now you can run HTML Help Workshop with the" \
+             ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+       $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+       @echo
+       @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+             ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+       @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Projectname.qhcp"
+       @echo "To view the help file:"
+       @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Projectname.qhc"
+
+devhelp:
+       $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+       @echo
+       @echo "Build finished."
+       @echo "To view the help file:"
+       @echo "# mkdir -p $$HOME/.local/share/devhelp/Projectname"
+       @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Projectname"
+       @echo "# devhelp"
+
+epub:
+       $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+       @echo
+       @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+       $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+       @echo
+       @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+       @echo "Run \`make' in that directory to run these through (pdf)latex" \
+             "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+       $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+       @echo "Running LaTeX files through pdflatex..."
+       $(MAKE) -C $(BUILDDIR)/latex all-pdf
+       @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+       $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+       @echo
+       @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+       $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+       @echo
+       @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+       $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+       @echo
+       @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+       @echo "Run \`make' in that directory to run these through makeinfo" \
+             "(use \`make info' here to do that automatically)."
+
+info:
+       $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+       @echo "Running Texinfo files through makeinfo..."
+       make -C $(BUILDDIR)/texinfo info
+       @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+       $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+       @echo
+       @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+       $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+       @echo
+       @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+       $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+       @echo
+       @echo "Link check complete; look for any errors in the above output " \
+             "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+       $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+       @echo "Testing of doctests in the sources finished, look at the " \
+             "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/Documentation/_make/_not_versioned/.gitignore b/Documentation/_make/_not_versioned/.gitignore
new file mode 100644 (file)
index 0000000..a1ad999
--- /dev/null
@@ -0,0 +1,7 @@
+# this is file .gitignore
+
+# ignore everything in this directory
+*
+
+# but do not ignore this this file
+!.gitignore
diff --git a/Documentation/_make/build/.gitignore b/Documentation/_make/build/.gitignore
new file mode 100644 (file)
index 0000000..a1ad999
--- /dev/null
@@ -0,0 +1,7 @@
+# this is file .gitignore
+
+# ignore everything in this directory
+*
+
+# but do not ignore this this file
+!.gitignore
diff --git a/Documentation/_make/conf.py b/Documentation/_make/conf.py
new file mode 100644 (file)
index 0000000..245c463
--- /dev/null
@@ -0,0 +1,373 @@
+# -*- coding: utf-8 -*-
+#
+# Project name documentation build configuration file, created by
+# sphinx-quickstart on Wed May 30 17:43:23 2012.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.ifconfig']
+
+# Add any paths that contain templates here, relative to this directory.
+# templates_path = ['_templates']
+templates_path = []
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'Index'
+
+# General information about the project.
+project   = u'Project name. Specify this in Settings.yml'
+copyright = u'Copyright note. Specify this in Settings.yml'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version. To be specified in Settings.yml.
+version = '1.0'
+# The full version, including alpha/beta/rc tags. To be specified in Settings.yml
+release = '1.0.0'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_make']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+# html_static_path = ['_static']
+html_static_path = []
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'Projectnamedoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('Index', 'Projectname.tex', u'Project name Documentation',
+   u'Author name(s)', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('Index', 'projectname', u'Project name Documentation',
+     [u'Author name(s)'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+#  dir menu entry, description, category)
+texinfo_documents = [
+  ('Index', 'Projectname', u'Project name Documentation',
+   u'Author name(s)', 'Projectname', 'One line description of project.',
+   'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+
+# -- Options for Epub output ---------------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title     = u'Project name'
+epub_author    = u'Author name(s)'
+epub_publisher = u'Author name(s)'
+epub_copyright = u'2012, Author name(s)'
+
+# The language of the text. It defaults to the language option
+# or en if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# A tuple containing the cover image and cover page html template filenames.
+#epub_cover = ()
+
+# A sequence of (type, uri, title) tuples for the guide element of content.opf.
+#epub_guide = ()
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files shat should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
+
+# Fix unsupported image types using the PIL.
+#epub_fix_images = False
+
+# Scale large images.
+#epub_max_image_width = 0
+
+
+# Example configuration for intersphinx: refer to the Python standard library.
+# intersphinx_mapping = {'http://docs.python.org/': None}
+intersphinx_mapping = {}
+
+
+#=================================================
+#
+# TYPO3 codeblock BEGIN:
+#
+# Insert this codeblock at the end of your Sphinx
+# builder configuration file 'conf.py'.
+# This may enable TYPO3 specific features like
+# TYPO3 themes. It makes Yaml settings files work.
+# 
+#-------------------------------------------------
+
+if 1 and "TYPO3 specific":
+
+    try:
+        t3DocTeam
+    except NameError:
+        t3DocTeam = {}
+
+    try:
+        import t3sphinx
+        html_theme_path.insert(0, t3sphinx.themes_dir)
+        html_theme = 'typo3sphinx'
+    except:
+        html_theme = 'default'
+
+    t3DocTeam['conf_py_file'] = None
+    try:
+        t3DocTeam['conf_py_file'] = __file__
+    except:
+        import inspect
+        t3DocTeam['conf_py_file'] = inspect.getfile(
+            inspect.currentframe())
+
+    t3DocTeam['conf_py_package_dir'] = os.path.abspath(os.path.dirname(
+        t3DocTeam['conf_py_file']))
+    t3DocTeam['relpath_to_master_doc'] = '..'
+    t3DocTeam['relpath_to_logdir'] = '_not_versioned'
+    t3DocTeam['path_to_logdir'] = os.path.join(
+        t3DocTeam['conf_py_package_dir'],
+        t3DocTeam['relpath_to_logdir'])
+    t3DocTeam['pathToYamlSettings'] = os.path.join(
+        t3DocTeam['conf_py_package_dir'], 
+        t3DocTeam['relpath_to_master_doc'], 'Settings.yml')
+    try:
+        t3DocTeam['pathToGlobalYamlSettings'] = \
+            t3sphinx.pathToGlobalYamlSettings
+    except:
+        t3DocTeam['pathToGlobalYamlSettings'] = None
+    if not t3DocTeam['pathToGlobalYamlSettings']:
+        t3DocTeam['pathToGlobalYamlSettings'] = os.path.join(
+            t3DocTeam['conf_py_package_dir'], 'GlobalSettings.yml')
+    try:
+        __function = t3sphinx.yamlsettings.processYamlSettings
+    except:
+        __function = None
+    if not __function:
+        try:
+            import yamlsettings
+            __function = yamlsettings.processYamlSettings
+        except:
+            __function = None
+    if __function:
+        __function(globals(), t3DocTeam)
+
+#-------------------------------------------------
+#
+# TYPO3 codeblock END.
+# 
+#=================================================
+
diff --git a/Documentation/_make/make-html.bat b/Documentation/_make/make-html.bat
new file mode 100644 (file)
index 0000000..147259d
--- /dev/null
@@ -0,0 +1,22 @@
+@echo off
+echo.
+echo.
+
+echo Building single file HTML version in build/singlehtml ...
+call make.bat singlehtml
+echo.
+echo.
+
+echo Building HTML version in build/html ...
+call make.bat html
+echo.
+echo.
+
+echo Starting build/html/Index.html in browser ...
+start build\html\Index.html
+echo.
+echo.
+
+
+echo Finished.
+pause
\ No newline at end of file
diff --git a/Documentation/_make/make.bat b/Documentation/_make/make.bat
new file mode 100644 (file)
index 0000000..506d7ef
--- /dev/null
@@ -0,0 +1,193 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXOPTS%" == "" (
+       set SPHINXOPTS=-c . -a -E -w ./_not_versioned/warnings.txt
+)
+if "%SPHINXBUILD%" == "" (
+       set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% ..
+set I18NSPHINXOPTS=%SPHINXOPTS% ..
+if NOT "%PAPER%" == "" (
+       set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+       set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+       :help
+       echo.Please use `make ^<target^>` where ^<target^> is one of
+       echo.  html       to make standalone HTML files
+       echo.  dirhtml    to make HTML files named index.html in directories
+       echo.  singlehtml to make a single large HTML file
+       echo.  pickle     to make pickle files
+       echo.  json       to make JSON files
+       echo.  htmlhelp   to make HTML files and a HTML help project
+       echo.  qthelp     to make HTML files and a qthelp project
+       echo.  devhelp    to make HTML files and a Devhelp project
+       echo.  epub       to make an epub
+       echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+       echo.  text       to make text files
+       echo.  man        to make manual pages
+       echo.  texinfo    to make Texinfo files
+       echo.  gettext    to make PO message catalogs
+       echo.  changes    to make an overview over all changed/added/deprecated items
+       echo.  linkcheck  to check all external links for integrity
+       echo.  doctest    to run all doctests embedded in the documentation if enabled
+       goto end
+)
+
+if "%1" == "clean" (
+       for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+       del /q /s %BUILDDIR%\*
+       goto end
+)
+
+if "%1" == "html" (
+       %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+       goto end
+)
+
+if "%1" == "dirhtml" (
+       %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+       goto end
+)
+
+if "%1" == "singlehtml" (
+       %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+       goto end
+)
+
+if "%1" == "pickle" (
+       %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished; now you can process the pickle files.
+       goto end
+)
+
+if "%1" == "json" (
+       %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished; now you can process the JSON files.
+       goto end
+)
+
+if "%1" == "htmlhelp" (
+       %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+       goto end
+)
+
+if "%1" == "qthelp" (
+       %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+       echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Projectname.qhcp
+       echo.To view the help file:
+       echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Projectname.ghc
+       goto end
+)
+
+if "%1" == "devhelp" (
+       %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished.
+       goto end
+)
+
+if "%1" == "epub" (
+       %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished. The epub file is in %BUILDDIR%/epub.
+       goto end
+)
+
+if "%1" == "latex" (
+       %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+       goto end
+)
+
+if "%1" == "text" (
+       %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished. The text files are in %BUILDDIR%/text.
+       goto end
+)
+
+if "%1" == "man" (
+       %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished. The manual pages are in %BUILDDIR%/man.
+       goto end
+)
+
+if "%1" == "texinfo" (
+       %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
+       goto end
+)
+
+if "%1" == "gettext" (
+       %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
+       goto end
+)
+
+if "%1" == "changes" (
+       %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.The overview file is in %BUILDDIR%/changes.
+       goto end
+)
+
+if "%1" == "linkcheck" (
+       %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+       goto end
+)
+
+if "%1" == "doctest" (
+       %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+       if errorlevel 1 exit /b 1
+       echo.
+       echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+       goto end
+)
+
+:end
index 076fdc8..db63c0e 100644 (file)
@@ -3,4 +3,16 @@ Resources/Public/Icons/google-maps-icon.png
 Url: http://www.iconarchive.com/show/google-play-icons-by-marcus-roberto/Google-Maps-icon.html
 Artist: Marcus Roberto
 Artist-Url: http://marcus-roberto.deviantart.com
-License: Free for personal desktop use only.
\ No newline at end of file
+License: Free for personal desktop use only.
+
+InfoBubble
+https://github.com/RelativeMedia/InfoBubble
+
+Hogan.js
+http://twitter.github.io/hogan.js/
+
+jQuery
+http://jquery.com/
+
+Google map stubs
+https://code.google.com/p/closure-compiler/source/browse/#git%2Fcontrib%2Fexterns%2Fmaps
\ No newline at end of file
index 395a992..2defb94 100644 (file)
                        <trans-unit id="submit_find">
                                <source>Find Store</source>
                        </trans-unit>
+                       <trans-unit id="route">
+                               <source>Route</source>
+                       </trans-unit>
+                       <trans-unit id="error_notvalidatable">
+                               <source>Model is not validatable</source>
+                       </trans-unit>
+                       <trans-unit id="error_required">
+                               <source>Required field may not be empty</source>
+                       </trans-unit>
+                       <trans-unit id="error_notexists">
+                               <source>Field does not exists</source>
+                       </trans-unit>
                </body>
        </file>
 </xliff>
\ No newline at end of file
index 75dadae..a521e70 100644 (file)
@@ -7,16 +7,14 @@
 <body>
 <f:section name="Main">
 
-       <f:form.validationResults for="user" as="validationResults">
+       <f:form.validationResults for="search">
                <f:if condition="{validationResults.flattenedErrors}">
-                       <f:for each="{validationResults.flattenedErrors}" key="propertyPath" as="propertyErrors">
-                               <f:for each="{propertyErrors}" as="propertyError">
-                                       <f:if condition="{propertyError.propertyName}=={field}">
-                                               <f:for each="{propertyError.errors}" as="error">
-                                                       <div class="error errorMessage errorField field{field -> f:cObject(typoscriptObjectPath: 'plugin.tx_storefinder.fieldError')}">{error.message}</div>
-                                               </f:for>
-                                       </f:if>
-                               </f:for>
+                       <f:for each="{validationResults.flattenedErrors}" key="fieldName" as="propertyErrors">
+                               <f:if condition="{fieldName}=={field}">
+                                       <f:for each="{propertyErrors}" as="propertyError">
+                                               <div class="error errorMessage errorField field{fieldName -> f:cObject(typoscriptObjectPath: 'plugin.tx_storefinder.fieldError')}">{propertyError.message}</div>
+                                       </f:for>
+                               </f:if>
                        </f:for>
                </f:if>
        </f:form.validationResults>
index 6a9e1b8..fcc7565 100644 (file)
@@ -8,8 +8,7 @@
 <body>
 <f:section name="content">
 <script type="text/javascript">
-       var mapConfiguration = {
-               <sf:minify>active: true,
+       var mapConfiguration = {<sf:minify>active: true,
                <f:for each="{settings.mapConfiguration}" as="configuration" key="name" iteration="loop">{name}: '{configuration}',</f:for>
                center: {
                        lat: <f:format.number decimals="7">{center.latitude}</f:format.number>,
                                icon: '{location.icon}',
                                state: '{location.state}',
                                country: '{location.country}',
-                               image: '{location.image}',
+                               image: '<f:for each="{location.image}" as="image">{f:uri.image(src: image.uid, width: 70, treatIdAsReference: 1)}</f:for>',
                                media: '{location.media}'
                        }
-               }</sf:minify><f:if condition="{loop.isLast}"><f:then></f:then><f:else>,</f:else></f:if></f:for>
+               }</sf:minify><f:if condition="{loop.isLast}"><f:then/><f:else>,</f:else></f:if></f:for>
        ];
 </script>
 
 <script id="templateInfoWindow" type="text/html">
        <div class="infoWindow group" style="width: 320px; height: 180px;" data-uid="{{uid}}">
-               <div class="storename">
-                       <span id="infoWindowMark{{uid}}" class="marker show"><img src="/typo3conf/ext/store_finder/Resources/Public/Images/addToNotepad.gif" title="Add to notepad" alt="Add to notepad"/></span>
-                       <span id="infoWindowUnMark{{uid}}" class="marker hide"><img src="/typo3conf/ext/store_finder/Resources/Public/Images/removeFromNotepad.gif" title="Remove from notepad" alt="Remove from notepad" /></span>
-                       <strong>{{title}}</strong>
-               </div>
+               <div class="storename"><strong>{{title}}</strong></div>
                <div class="right">
-                       <div class="image">{{image}}</div>
+                       <div class="image">{{#image}}<img src="{{image}}"/>{{/image}}</div>
                        <div class="displayRoute">
-                               <a href="/index.php?id=5&tx_locator_pi1%5Bdummy%5D=showMap&tx_locator_pi1%5Bmode%5D=showRoute&tx_locator_pi1%5BstoreUid%5D=1&tx_locator_pi1%5BstartZipcode%5D=&tx_locator_pi1%5BstartCity%5D=&tx_locator_pi1%5BstartAddress%5D=&tx_locator_pi1%5BstartCountry%5D=&tx_locator_pi1%5BstartLat%5D=51.5084358&tx_locator_pi1%5BstartLon%5D=7.097707&tx_locator_pi1%5Blat%5D=51.5084358&tx_locator_pi1%5Blon%5D=7.097707&tx_locator_pi1%5Bdistance%5D=0%2C00" target="_top">Route</a>
+                               <a href="https://maps.google.com/?daddr={{lat}},{{lng}}" target="_top"><f:translate key="route"/></a>
                        </div>
                </div>
                <div class="left">
index a56db42..8e00e67 100644 (file)
@@ -1,8 +1,3 @@
-// ==ClosureCompiler==
-// @compilation_level ADVANCED_OPTIMIZATIONS
-// @externs_url http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/maps/google_maps_api_v3.js
-// ==/ClosureCompiler==
-
 // https://github.com/RelativeMedia/InfoBubble
 
 /**
@@ -14,7 +9,7 @@
  * drop shadows and animations. It also allows tabs
  */
 
-/*
+/**
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -28,6 +23,7 @@
  * limitations under the License.
  */
 
+// https://maps.googleapis.com/maps/api/js?v=3.exp&callback=initializeMap&sensor=false&language=de
 
 /**
  * A CSS3 InfoBubble v0.8
  * @constructor
  */
 function InfoBubble(opt_options) {
-  this.extend(InfoBubble, google.maps.OverlayView);
-  this.tabs_ = [];
-  this.activeTab_ = null;
-  this.baseZIndex_ = 100;
-  this.isOpen_ = false;
+       this.extend(InfoBubble, google.maps.OverlayView);
+       this.tabs_ = [];
+       this.activeTab_ = null;
+       this.baseZIndex_ = 100;
+       this.isOpen_ = false;
 
-  var options = opt_options || {};
+       var options = opt_options || {};
 
-  if (options['backgroundColor'] == undefined) {
-    options['backgroundColor'] = this.BACKGROUND_COLOR_;
-  }
+       if (options['backgroundColor'] == undefined) {
+               options['backgroundColor'] = this.BACKGROUND_COLOR_;
+       }
 
-  if (options['borderColor'] == undefined) {
-    options['borderColor'] = this.BORDER_COLOR_;
-  }
+       if (options['borderColor'] == undefined) {
+               options['borderColor'] = this.BORDER_COLOR_;
+       }
 
-  if (options['borderRadius'] == undefined) {
-    options['borderRadius'] = this.BORDER_RADIUS_;
-  }
+       if (options['borderRadius'] == undefined) {
+               options['borderRadius'] = this.BORDER_RADIUS_;
+       }
 
-  if (options['borderWidth'] == undefined) {
-    options['borderWidth'] = this.BORDER_WIDTH_;
-  }
+       if (options['borderWidth'] == undefined) {
+               options['borderWidth'] = this.BORDER_WIDTH_;
+       }
 
-  if (options['padding'] == undefined) {
-    options['padding'] = this.PADDING_;
-  }
+       if (options['padding'] == undefined) {
+               options['padding'] = this.PADDING_;
+       }
 
-  if(options['tabPadding'] == undefined) {
-    options['tabPadding'] == this.TABPADDING_;
-  }
+       if (options['tabPadding'] == undefined) {
+               options['tabPadding'] = this.TABPADDING_;
+       }
 
-  if (options['arrowPosition'] == undefined) {
-    options['arrowPosition'] = this.ARROW_POSITION_;
-  }
+       if (options['arrowPosition'] == undefined) {
+               options['arrowPosition'] = this.ARROW_POSITION_;
+       }
 
-  if (options['disableAutoPan'] == undefined) {
-    options['disableAutoPan'] = false;
-  }
+       if (options['disableAutoPan'] == undefined) {
+               options['disableAutoPan'] = false;
+       }
 
-  if (options['disableAnimation'] == undefined) {
-    options['disableAnimation'] = false;
-  }
+       if (options['disableAnimation'] == undefined) {
+               options['disableAnimation'] = false;
+       }
 
-  if (options['minWidth'] == undefined) {
-    options['minWidth'] = this.MIN_WIDTH_;
-  }
+       if (options['minWidth'] == undefined) {
+               options['minWidth'] = this.MIN_WIDTH_;
+       }
 
-  if (options['shadowStyle'] == undefined) {
-    options['shadowStyle'] = this.SHADOW_STYLE_;
-  }
+       if (options['shadowStyle'] == undefined) {
+               options['shadowStyle'] = this.SHADOW_STYLE_;
+       }
 
-  if (options['arrowSize'] == undefined) {
-    options['arrowSize'] = this.ARROW_SIZE_;
-  }
+       if (options['arrowSize'] == undefined) {
+               options['arrowSize'] = this.ARROW_SIZE_;
+       }
 
-  if (options['arrowStyle'] == undefined) {
-    options['arrowStyle'] = this.ARROW_STYLE_;
-  }
+       if (options['arrowStyle'] == undefined) {
+               options['arrowStyle'] = this.ARROW_STYLE_;
+       }
 
-  this.buildDom_();
+       this.buildDom_();
 
-  this.setValues(options);
+       this.setValues(options);
 }
 window['InfoBubble'] = InfoBubble;
 
@@ -110,7 +106,6 @@ window['InfoBubble'] = InfoBubble;
  */
 InfoBubble.prototype.ARROW_SIZE_ = 15;
 
-
 /**
  * Default arrow style
  * @const
@@ -118,7 +113,6 @@ InfoBubble.prototype.ARROW_SIZE_ = 15;
  */
 InfoBubble.prototype.ARROW_STYLE_ = 0;
 
-
 /**
  * Default shadow style
  * @const
@@ -126,7 +120,6 @@ InfoBubble.prototype.ARROW_STYLE_ = 0;
  */
 InfoBubble.prototype.SHADOW_STYLE_ = 1;
 
-
 /**
  * Default min width
  * @const
@@ -134,7 +127,6 @@ InfoBubble.prototype.SHADOW_STYLE_ = 1;
  */
 InfoBubble.prototype.MIN_WIDTH_ = 50;
 
-
 /**
  * Default arrow position
  * @const
@@ -142,7 +134,6 @@ InfoBubble.prototype.MIN_WIDTH_ = 50;
  */
 InfoBubble.prototype.ARROW_POSITION_ = 50;
 
-
 /**
  * Default padding
  * @const
@@ -164,7 +155,6 @@ InfoBubble.prototype.TABPADDING_ = 10;
  */
 InfoBubble.prototype.BORDER_WIDTH_ = 1;
 
-
 /**
  * Default border color
  * @const
@@ -172,7 +162,6 @@ InfoBubble.prototype.BORDER_WIDTH_ = 1;
  */
 InfoBubble.prototype.BORDER_COLOR_ = '#ccc';
 
-
 /**
  * Default border radius
  * @const
@@ -180,7 +169,6 @@ InfoBubble.prototype.BORDER_COLOR_ = '#ccc';
  */
 InfoBubble.prototype.BORDER_RADIUS_ = 10;
 
-
 /**
  * Default background color
  * @const
@@ -197,103 +185,107 @@ InfoBubble.prototype.BACKGROUND_COLOR_ = '#fff';
  * @return {Object} The new extended object.
  * @ignore
  */
-InfoBubble.prototype.extend = function(obj1, obj2) {
-  return (function(object) {
-    for (var property in object.prototype) {
-      this.prototype[property] = object.prototype[property];
-    }
-    return this;
-  }).apply(obj1, [obj2]);
+InfoBubble.prototype.extend = function (obj1, obj2) {
+       return (function (object) {
+               var property;
+               for (property in object.prototype) {
+                       if (object.prototype.hasOwnProperty(property) && this.prototype.hasOwnProperty(property)) {
+                               this.prototype[property] = object.prototype[property];
+                       }
+               }
+               return this;
+       }).apply(obj1, [obj2]);
 };
 
 
 /**
  * Builds the InfoBubble dom
+ *
  * @private
  */
-InfoBubble.prototype.buildDom_ = function() {
-  var bubble = this.bubble_ = document.createElement('DIV');
-  bubble.style['position'] = 'absolute';
-  bubble.style['zIndex'] = this.baseZIndex_;
-
-  var tabsContainer = this.tabsContainer_ = document.createElement('DIV');
-  tabsContainer.style['position'] = 'relative';
-
-  // Close button
-  var close = this.close_ = document.createElement('IMG');
-  close.style['position'] = 'absolute';
-  close.style['width'] = this.px(12);
-  close.style['height'] = this.px(12);
-  close.style['border'] = 0;
-  close.style['zIndex'] = this.baseZIndex_ + 1;
-  close.style['cursor'] = 'pointer';
-  close.src = 'http://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif';
-
-  var that = this;
-  google.maps.event.addDomListener(close, 'click', function() {
-    that.close();
-    google.maps.event.trigger(that, 'closeclick');
-  });
-
-  // Content area
-  var contentContainer = this.contentContainer_ = document.createElement('DIV');
-  contentContainer.style['overflowX'] = 'auto';
-  contentContainer.style['overflowY'] = 'auto';
-  contentContainer.style['cursor'] = 'default';
-  contentContainer.style['clear'] = 'both';
-  contentContainer.style['position'] = 'relative';
-
-  var content = this.content_ = document.createElement('DIV');
-  contentContainer.appendChild(content);
-
-  // Arrow
-  var arrow = this.arrow_ = document.createElement('DIV');
-  arrow.style['position'] = 'relative';
-
-  var arrowOuter = this.arrowOuter_ = document.createElement('DIV');
-  var arrowInner = this.arrowInner_ = document.createElement('DIV');
-
-  var arrowSize = this.getArrowSize_();
-
-  arrowOuter.style['position'] = arrowInner.style['position'] = 'absolute';
-  arrowOuter.style['left'] = arrowInner.style['left'] = '50%';
-  arrowOuter.style['height'] = arrowInner.style['height'] = '0';
-  arrowOuter.style['width'] = arrowInner.style['width'] = '0';
-  arrowOuter.style['marginLeft'] = this.px(-arrowSize);
-  arrowOuter.style['borderWidth'] = this.px(arrowSize);
-  arrowOuter.style['borderBottomWidth'] = 0;
-
-  // Shadow
-  var bubbleShadow = this.bubbleShadow_ = document.createElement('DIV');
-  bubbleShadow.style['position'] = 'absolute';
-
-  // Hide the InfoBubble by default
-  bubble.style['display'] = bubbleShadow.style['display'] = 'none';
-
-  bubble.appendChild(this.tabsContainer_);
-  bubble.appendChild(close);
-  bubble.appendChild(contentContainer);
-  arrow.appendChild(arrowOuter);
-  arrow.appendChild(arrowInner);
-  bubble.appendChild(arrow);
-
-  var stylesheet = document.createElement('style');
-  stylesheet.setAttribute('type', 'text/css');
-
-  /**
-   * The animation for the infobubble
-   * @type {string}
-   */
-  this.animationName_ = '_ibani_' + Math.round(Math.random() * 10000);
-
-  stylesheet.textContent = '.' + this.animationName_ + '{-webkit-animation-name:' +
-      this.animationName_ + ';-webkit-animation-duration:0.5s;' +
-      '-webkit-animation-iteration-count:1;}' +
-      '@-webkit-keyframes ' + this.animationName_ + ' {from {' +
-      '-webkit-transform: scale(0)}50% {-webkit-transform: scale(1.2)}90% ' +
-      '{-webkit-transform: scale(0.95)}to {-webkit-transform: scale(1)}}';
-
-  document.getElementsByTagName('head')[0].appendChild(stylesheet);
+InfoBubble.prototype.buildDom_ = function () {
+       var bubble = this.bubble_ = document.createElement('DIV');
+       bubble.style['position'] = 'absolute';
+       bubble.style['zIndex'] = this.baseZIndex_;
+
+       var tabsContainer = this.tabsContainer_ = document.createElement('DIV');
+       tabsContainer.style['position'] = 'relative';
+
+       // Close button
+       var close = this.close_ = document.createElement('IMG');
+       close.style['position'] = 'absolute';
+       close.style['width'] = this.px(12);
+       close.style['height'] = this.px(12);
+       close.style['border'] = 0;
+       close.style['zIndex'] = this.baseZIndex_ + 1;
+       close.style['cursor'] = 'pointer';
+       close.src = 'http://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif';
+
+       var that = this;
+       google.maps.event.addDomListener(close, 'click', function () {
+               that.close();
+               google.maps.event.trigger(that, 'closeclick');
+       });
+
+       // Content area
+       var contentContainer = this.contentContainer_ = document.createElement('DIV');
+       contentContainer.style['overflowX'] = 'auto';
+       contentContainer.style['overflowY'] = 'auto';
+       contentContainer.style['cursor'] = 'default';
+       contentContainer.style['clear'] = 'both';
+       contentContainer.style['position'] = 'relative';
+
+       var content = this.content_ = document.createElement('DIV');
+       contentContainer.appendChild(content);
+
+       // Arrow
+       var arrow = this.arrow_ = document.createElement('DIV');
+       arrow.style['position'] = 'relative';
+
+       var arrowOuter = this.arrowOuter_ = document.createElement('DIV');
+       var arrowInner = this.arrowInner_ = document.createElement('DIV');
+
+       var arrowSize = this.getArrowSize_();
+
+       arrowOuter.style['position'] = arrowInner.style['position'] = 'absolute';
+       arrowOuter.style['left'] = arrowInner.style['left'] = '50%';
+       arrowOuter.style['height'] = arrowInner.style['height'] = '0';
+       arrowOuter.style['width'] = arrowInner.style['width'] = '0';
+       arrowOuter.style['marginLeft'] = this.px(-arrowSize);
+       arrowOuter.style['borderWidth'] = this.px(arrowSize);
+       arrowOuter.style['borderBottomWidth'] = 0;
+
+       // Shadow
+       var bubbleShadow = this.bubbleShadow_ = document.createElement('DIV');
+       bubbleShadow.style['position'] = 'absolute';
+
+       // Hide the InfoBubble by default
+       bubble.style['display'] = bubbleShadow.style['display'] = 'none';
+
+       bubble.appendChild(this.tabsContainer_);
+       bubble.appendChild(close);
+       bubble.appendChild(contentContainer);
+       arrow.appendChild(arrowOuter);
+       arrow.appendChild(arrowInner);
+       bubble.appendChild(arrow);
+
+       var stylesheet = document.createElement('style');
+       stylesheet.setAttribute('type', 'text/css');
+
+       /**
+        * The animation for the infobubble
+        * @type {string}
+        */
+       this.animationName_ = '_ibani_' + Math.round(Math.random() * 10000);
+
+       stylesheet.textContent = '.' + this.animationName_ + '{-webkit-animation-name:' +
+               this.animationName_ + ';-webkit-animation-duration:0.5s;' +
+               '-webkit-animation-iteration-count:1;}' +
+               '@-webkit-keyframes ' + this.animationName_ + ' {from {' +
+               '-webkit-transform: scale(0)}50% {-webkit-transform: scale(1.2)}90% ' +
+               '{-webkit-transform: scale(0.95)}to {-webkit-transform: scale(1)}}';
+
+       document.getElementsByTagName('head')[0].appendChild(stylesheet);
 };
 
 
@@ -302,21 +294,19 @@ InfoBubble.prototype.buildDom_ = function() {
  *
  * @param {string} className The class name to set.
  */
-InfoBubble.prototype.setBackgroundClassName = function(className) {
-  this.set('backgroundClassName', className);
+InfoBubble.prototype.setBackgroundClassName = function (className) {
+       this.set('backgroundClassName', className);
 };
-InfoBubble.prototype['setBackgroundClassName'] =
-    InfoBubble.prototype.setBackgroundClassName;
+InfoBubble.prototype['setBackgroundClassName'] = InfoBubble.prototype.setBackgroundClassName;
 
 
 /**
  * changed MVC callback
  */
-InfoBubble.prototype.backgroundClassName_changed = function() {
-  this.content_.className = this.get('backgroundClassName');
+InfoBubble.prototype.backgroundClassName_changed = function () {
+       this.content_.className = this.get('backgroundClassName');
 };
-InfoBubble.prototype['backgroundClassName_changed'] =
-    InfoBubble.prototype.backgroundClassName_changed;
+InfoBubble.prototype['backgroundClassName_changed'] = InfoBubble.prototype.backgroundClassName_changed;
 
 
 /**
@@ -324,31 +314,30 @@ InfoBubble.prototype['backgroundClassName_changed'] =
  *
  * @param {string} className the class name to set.
  */
-InfoBubble.prototype.setTabClassName = function(className) {
-  this.set('tabClassName', className);
+InfoBubble.prototype.setTabClassName = function (className) {
+       this.set('tabClassName', className);
 };
-InfoBubble.prototype['setTabClassName'] =
-    InfoBubble.prototype.setTabClassName;
+InfoBubble.prototype['setTabClassName'] = InfoBubble.prototype.setTabClassName;
+
 
 /**
  * Sets the class of the active Tab
  *
  * @param {string} activeTabClassName the class name to set.
  */
-InfoBubble.prototype.setActiveTabClassName = function(activeTabClassName) {
-  this.set('activeTabClassName', activeTabClassName);
+InfoBubble.prototype.setActiveTabClassName = function (activeTabClassName) {
+       this.set('activeTabClassName', activeTabClassName);
 };
-InfoBubble.prototype['activeTabClassName'] =
-    InfoBubble.prototype.setActiveTabClassName;
+InfoBubble.prototype['activeTabClassName'] = InfoBubble.prototype.setActiveTabClassName;
+
 
 /**
  * tabClassName changed MVC callback
  */
-InfoBubble.prototype.tabClassName_changed = function() {
-  this.updateTabStyles_();
+InfoBubble.prototype.tabClassName_changed = function () {
+       this.updateTabStyles_();
 };
-InfoBubble.prototype['tabClassName_changed'] =
-    InfoBubble.prototype.tabClassName_changed;
+InfoBubble.prototype['tabClassName_changed'] = InfoBubble.prototype.tabClassName_changed;
 
 
 /**
@@ -357,8 +346,8 @@ InfoBubble.prototype['tabClassName_changed'] =
  * @private
  * @return {number} The style of the arrow.
  */
-InfoBubble.prototype.getArrowStyle_ = function() {
-  return parseInt(this.get('arrowStyle'), 10) || 0;
+InfoBubble.prototype.getArrowStyle_ = function () {
+       return parseInt(this.get('arrowStyle'), 10) || 0;
 };
 
 
@@ -367,21 +356,19 @@ InfoBubble.prototype.getArrowStyle_ = function() {
  *
  * @param {number} style The style of the arrow.
  */
-InfoBubble.prototype.setArrowStyle = function(style) {
-  this.set('arrowStyle', style);
+InfoBubble.prototype.setArrowStyle = function (style) {
+       this.set('arrowStyle', style);
 };
-InfoBubble.prototype['setArrowStyle'] =
-    InfoBubble.prototype.setArrowStyle;
+InfoBubble.prototype['setArrowStyle'] = InfoBubble.prototype.setArrowStyle;
 
 
 /**
  * Arrow style changed MVC callback
  */
-InfoBubble.prototype.arrowStyle_changed = function() {
-  this.arrowSize_changed();
+InfoBubble.prototype.arrowStyle_changed = function () {
+       this.arrowSize_changed();
 };
-InfoBubble.prototype['arrowStyle_changed'] =
-    InfoBubble.prototype.arrowStyle_changed;
+InfoBubble.prototype['arrowStyle_changed'] = InfoBubble.prototype.arrowStyle_changed;
 
 
 /**
@@ -390,8 +377,8 @@ InfoBubble.prototype['arrowStyle_changed'] =
  * @private
  * @return {number} The size of the arrow.
  */
-InfoBubble.prototype.getArrowSize_ = function() {
-  return parseInt(this.get('arrowSize'), 10) || 0;
+InfoBubble.prototype.getArrowSize_ = function () {
+       return parseInt(this.get('arrowSize'), 10) || 0;
 };
 
 
@@ -400,21 +387,19 @@ InfoBubble.prototype.getArrowSize_ = function() {
  *
  * @param {number} size The size of the arrow.
  */
-InfoBubble.prototype.setArrowSize = function(size) {
-  this.set('arrowSize', size);
+InfoBubble.prototype.setArrowSize = function (size) {
+       this.set('arrowSize', size);
 };
-InfoBubble.prototype['setArrowSize'] =
-    InfoBubble.prototype.setArrowSize;
+InfoBubble.prototype['setArrowSize'] = InfoBubble.prototype.setArrowSize;
 
 
 /**
  * Arrow size changed MVC callback
  */
-InfoBubble.prototype.arrowSize_changed = function() {
-  this.borderWidth_changed();
+InfoBubble.prototype.arrowSize_changed = function () {
+       this.borderWidth_changed();
 };
-InfoBubble.prototype['arrowSize_changed'] =
-    InfoBubble.prototype.arrowSize_changed;
+InfoBubble.prototype['arrowSize_changed'] = InfoBubble.prototype.arrowSize_changed;
 
 
 /**
@@ -422,11 +407,10 @@ InfoBubble.prototype['arrowSize_changed'] =
  *
  * @param {number} pos The position to set.
  */
-InfoBubble.prototype.setArrowPosition = function(pos) {
-  this.set('arrowPosition', pos);
+InfoBubble.prototype.setArrowPosition = function (pos) {
+       this.set('arrowPosition', pos);
 };
-InfoBubble.prototype['setArrowPosition'] =
-    InfoBubble.prototype.setArrowPosition;
+InfoBubble.prototype['setArrowPosition'] = InfoBubble.prototype.setArrowPosition;
 
 
 /**
@@ -435,22 +419,21 @@ InfoBubble.prototype['setArrowPosition'] =
  * @private
  * @return {number} The position..
  */
-InfoBubble.prototype.getArrowPosition_ = function() {
-  return parseInt(this.get('arrowPosition'), 10) || 0;
+InfoBubble.prototype.getArrowPosition_ = function () {
+       return parseInt(this.get('arrowPosition'), 10) || 0;
 };
 
 
 /**
  * arrowPosition changed MVC callback
  */
-InfoBubble.prototype.arrowPosition_changed = function() {
-  var pos = this.getArrowPosition_();
-  this.arrowOuter_.style['left'] = this.arrowInner_.style['left'] = pos + '%';
+InfoBubble.prototype.arrowPosition_changed = function () {
+       var pos = this.getArrowPosition_();
+       this.arrowOuter_.style['left'] = this.arrowInner_.style['left'] = pos + '%';
 
-  this.redraw_();
+       this.redraw_();
 };
-InfoBubble.prototype['arrowPosition_changed'] =
-    InfoBubble.prototype.arrowPosition_changed;
+InfoBubble.prototype['arrowPosition_changed'] = InfoBubble.prototype.arrowPosition_changed;
 
 
 /**
@@ -458,8 +441,8 @@ InfoBubble.prototype['arrowPosition_changed'] =
  *
  * @param {number} zIndex The zIndex to set.
  */
-InfoBubble.prototype.setZIndex = function(zIndex) {
-  this.set('zIndex', zIndex);
+InfoBubble.prototype.setZIndex = function (zIndex) {
+       this.set('zIndex', zIndex);
 };
 InfoBubble.prototype['setZIndex'] = InfoBubble.prototype.setZIndex;
 
@@ -469,19 +452,19 @@ InfoBubble.prototype['setZIndex'] = InfoBubble.prototype.setZIndex;
  *
  * @return {number} The zIndex to set.
  */
-InfoBubble.prototype.getZIndex = function() {
-  return parseInt(this.get('zIndex'), 10) || this.baseZIndex_;
+InfoBubble.prototype.getZIndex = function () {
+       return parseInt(this.get('zIndex'), 10) || this.baseZIndex_;
 };
 
 
 /**
  * zIndex changed MVC callback
  */
-InfoBubble.prototype.zIndex_changed = function() {
-  var zIndex = this.getZIndex();
+InfoBubble.prototype.zIndex_changed = function () {
+       var zIndex = this.getZIndex();
 
-  this.bubble_.style['zIndex'] = this.baseZIndex_ = zIndex;
-  this.close_.style['zIndex'] = zIndex + 1;
+       this.bubble_.style['zIndex'] = this.baseZIndex_ = zIndex;
+       this.close_.style['zIndex'] = zIndex + 1;
 };
 InfoBubble.prototype['zIndex_changed'] = InfoBubble.prototype.zIndex_changed;
 
@@ -491,8 +474,8 @@ InfoBubble.prototype['zIndex_changed'] = InfoBubble.prototype.zIndex_changed;
  *
  * @param {number} shadowStyle The style of the shadow.
  */
-InfoBubble.prototype.setShadowStyle = function(shadowStyle) {
-  this.set('shadowStyle', shadowStyle);
+InfoBubble.prototype.setShadowStyle = function (shadowStyle) {
+       this.set('shadowStyle', shadowStyle);
 };
 InfoBubble.prototype['setShadowStyle'] = InfoBubble.prototype.setShadowStyle;
 
@@ -503,51 +486,52 @@ InfoBubble.prototype['setShadowStyle'] = InfoBubble.prototype.setShadowStyle;
  * @private
  * @return {number} The style of the shadow.
  */
-InfoBubble.prototype.getShadowStyle_ = function() {
-  return parseInt(this.get('shadowStyle'), 10) || 0;
+InfoBubble.prototype.getShadowStyle_ = function () {
+       return parseInt(this.get('shadowStyle'), 10) || 0;
 };
 
 
 /**
  * shadowStyle changed MVC callback
  */
-InfoBubble.prototype.shadowStyle_changed = function() {
-  var shadowStyle = this.getShadowStyle_();
-
-  var display = '';
-  var shadow = '';
-  var backgroundColor = '';
-  switch (shadowStyle) {
-    case 0:
-      display = 'none';
-      break;
-    case 1:
-      shadow = '40px 15px 10px rgba(33,33,33,0.3)';
-      backgroundColor = 'transparent';
-      break;
-    case 2:
-      shadow = '0 0 2px rgba(33,33,33,0.3)';
-      backgroundColor = 'rgba(33,33,33,0.35)';
-      break;
-  }
-  this.bubbleShadow_.style['boxShadow'] =
-      this.bubbleShadow_.style['webkitBoxShadow'] =
-      this.bubbleShadow_.style['MozBoxShadow'] = shadow;
-  this.bubbleShadow_.style['backgroundColor'] = backgroundColor;
-  if (this.isOpen_) {
-    this.bubbleShadow_.style['display'] = display;
-    this.draw();
-  }
-};
-InfoBubble.prototype['shadowStyle_changed'] =
-    InfoBubble.prototype.shadowStyle_changed;
+InfoBubble.prototype.shadowStyle_changed = function () {
+       var shadowStyle = this.getShadowStyle_();
+
+       var display = '';
+       var shadow = '';
+       var backgroundColor = '';
+       switch (shadowStyle) {
+               case 0:
+                       display = 'none';
+                       break;
+
+               case 1:
+                       shadow = '40px 15px 10px rgba(33,33,33,0.3)';
+                       backgroundColor = 'transparent';
+                       break;
+
+               case 2:
+                       shadow = '0 0 2px rgba(33,33,33,0.3)';
+                       backgroundColor = 'rgba(33,33,33,0.35)';
+                       break;
+       }
+       this.bubbleShadow_.style['boxShadow'] =
+               this.bubbleShadow_.style['webkitBoxShadow'] =
+                       this.bubbleShadow_.style['MozBoxShadow'] = shadow;
+       this.bubbleShadow_.style['backgroundColor'] = backgroundColor;
+       if (this.isOpen_) {
+               this.bubbleShadow_.style['display'] = display;
+               this.draw();
+       }
+};
+InfoBubble.prototype['shadowStyle_changed'] = InfoBubble.prototype.shadowStyle_changed;
 
 
 /**
  * Show the close button
  */
-InfoBubble.prototype.showCloseButton = function() {
-  this.set('hideCloseButton', false);
+InfoBubble.prototype.showCloseButton = function () {
+       this.set('hideCloseButton', false);
 };
 InfoBubble.prototype['showCloseButton'] = InfoBubble.prototype.showCloseButton;
 
@@ -555,8 +539,8 @@ InfoBubble.prototype['showCloseButton'] = InfoBubble.prototype.showCloseButton;
 /**
  * Hide the close button
  */
-InfoBubble.prototype.hideCloseButton = function() {
-  this.set('hideCloseButton', true);
+InfoBubble.prototype.hideCloseButton = function () {
+       this.set('hideCloseButton', true);
 };
 InfoBubble.prototype['hideCloseButton'] = InfoBubble.prototype.hideCloseButton;
 
@@ -564,11 +548,10 @@ InfoBubble.prototype['hideCloseButton'] = InfoBubble.prototype.hideCloseButton;
 /**
  * hideCloseButton changed MVC callback
  */
-InfoBubble.prototype.hideCloseButton_changed = function() {
-  this.close_.style['display'] = this.get('hideCloseButton') ? 'none' : '';
+InfoBubble.prototype.hideCloseButton_changed = function () {
+       this.close_.style['display'] = this.get('hideCloseButton') ? 'none' : '';
 };
-InfoBubble.prototype['hideCloseButton_changed'] =
-    InfoBubble.prototype.hideCloseButton_changed;
+InfoBubble.prototype['hideCloseButton_changed'] = InfoBubble.prototype.hideCloseButton_changed;
 
 
 /**
@@ -576,28 +559,26 @@ InfoBubble.prototype['hideCloseButton_changed'] =
  *
  * @param {string} color The color to set.
  */
-InfoBubble.prototype.setBackgroundColor = function(color) {
-  if (color) {
-    this.set('backgroundColor', color);
-  }
+InfoBubble.prototype.setBackgroundColor = function (color) {
+       if (color) {
+               this.set('backgroundColor', color);
+       }
 };
-InfoBubble.prototype['setBackgroundColor'] =
-    InfoBubble.prototype.setBackgroundColor;
+InfoBubble.prototype['setBackgroundColor'] = InfoBubble.prototype.setBackgroundColor;
 
 
 /**
  * backgroundColor changed MVC callback
  */
-InfoBubble.prototype.backgroundColor_changed = function() {
-  var backgroundColor = this.get('backgroundColor');
-  this.contentContainer_.style['backgroundColor'] = backgroundColor;
+InfoBubble.prototype.backgroundColor_changed = function () {
+       var backgroundColor = this.get('backgroundColor');
+       this.contentContainer_.style['backgroundColor'] = backgroundColor;
 
-  this.arrowInner_.style['borderColor'] = backgroundColor +
-      ' transparent transparent';
-  this.updateTabStyles_();
+       this.arrowInner_.style['borderColor'] = backgroundColor +
+               ' transparent transparent';
+       this.updateTabStyles_();
 };
-InfoBubble.prototype['backgroundColor_changed'] =
-    InfoBubble.prototype.backgroundColor_changed;
+InfoBubble.prototype['backgroundColor_changed'] = InfoBubble.prototype.backgroundColor_changed;
 
 
 /**
@@ -605,10 +586,10 @@ InfoBubble.prototype['backgroundColor_changed'] =
  *
  * @param {string} color The border color.
  */
-InfoBubble.prototype.setBorderColor = function(color) {
-  if (color) {
-    this.set('borderColor', color);
-  }
+InfoBubble.prototype.setBorderColor = function (color) {
+       if (color) {
+               this.set('borderColor', color);
+       }
 };
 InfoBubble.prototype['setBorderColor'] = InfoBubble.prototype.setBorderColor;
 
@@ -616,24 +597,23 @@ InfoBubble.prototype['setBorderColor'] = InfoBubble.prototype.setBorderColor;
 /**
  * borderColor changed MVC callback
  */
-InfoBubble.prototype.borderColor_changed = function() {
-  var borderColor = this.get('borderColor');
+InfoBubble.prototype.borderColor_changed = function () {
+       var borderColor = this.get('borderColor');
 
-  var contentContainer = this.contentContainer_;
-  var arrowOuter = this.arrowOuter_;
-  contentContainer.style['borderColor'] = borderColor;
+       var contentContainer = this.contentContainer_;
+       var arrowOuter = this.arrowOuter_;
+       contentContainer.style['borderColor'] = borderColor;
 
-  arrowOuter.style['borderColor'] = borderColor +
-      ' transparent transparent';
+       arrowOuter.style['borderColor'] = borderColor +
+               ' transparent transparent';
 
-  contentContainer.style['borderStyle'] =
-      arrowOuter.style['borderStyle'] =
-      this.arrowInner_.style['borderStyle'] = 'solid';
+       contentContainer.style['borderStyle'] =
+               arrowOuter.style['borderStyle'] =
+                       this.arrowInner_.style['borderStyle'] = 'solid';
 
-  this.updateTabStyles_();
+       this.updateTabStyles_();
 };
-InfoBubble.prototype['borderColor_changed'] =
-    InfoBubble.prototype.borderColor_changed;
+InfoBubble.prototype['borderColor_changed'] = InfoBubble.prototype.borderColor_changed;
 
 
 /**
@@ -641,8 +621,8 @@ InfoBubble.prototype['borderColor_changed'] =
  *
  * @param {number} radius The radius of the border.
  */
-InfoBubble.prototype.setBorderRadius = function(radius) {
-  this.set('borderRadius', radius);
+InfoBubble.prototype.setBorderRadius = function (radius) {
+       this.set('borderRadius', radius);
 };
 InfoBubble.prototype['setBorderRadius'] = InfoBubble.prototype.setBorderRadius;
 
@@ -653,33 +633,32 @@ InfoBubble.prototype['setBorderRadius'] = InfoBubble.prototype.setBorderRadius;
  * @private
  * @return {number} The radius of the border.
  */
-InfoBubble.prototype.getBorderRadius_ = function() {
-  return parseInt(this.get('borderRadius'), 10) || 0;
+InfoBubble.prototype.getBorderRadius_ = function () {
+       return parseInt(this.get('borderRadius'), 10) || 0;
 };
 
 
 /**
  * borderRadius changed MVC callback
  */
-InfoBubble.prototype.borderRadius_changed = function() {
-  var borderRadius = this.getBorderRadius_();
-  var borderWidth = this.getBorderWidth_();
+InfoBubble.prototype.borderRadius_changed = function () {
+       var borderRadius = this.getBorderRadius_();
+       var borderWidth = this.getBorderWidth_();
 
-  this.contentContainer_.style['borderRadius'] =
-      this.contentContainer_.style['MozBorderRadius'] =
-      this.contentContainer_.style['webkitBorderRadius'] =
-      this.bubbleShadow_.style['borderRadius'] =
-      this.bubbleShadow_.style['MozBorderRadius'] =
-      this.bubbleShadow_.style['webkitBorderRadius'] = this.px(borderRadius);
+       this.contentContainer_.style['borderRadius'] =
+               this.contentContainer_.style['MozBorderRadius'] =
+                       this.contentContainer_.style['webkitBorderRadius'] =
+                               this.bubbleShadow_.style['borderRadius'] =
+                                       this.bubbleShadow_.style['MozBorderRadius'] =
+                                               this.bubbleShadow_.style['webkitBorderRadius'] = this.px(borderRadius);
 
-  this.tabsContainer_.style['paddingLeft'] =
-      this.tabsContainer_.style['paddingRight'] =
-      this.px(borderRadius + borderWidth);
+       this.tabsContainer_.style['paddingLeft'] =
+               this.tabsContainer_.style['paddingRight'] =
+                       this.px(borderRadius + borderWidth);
 
-  this.redraw_();
+       this.redraw_();
 };
-InfoBubble.prototype['borderRadius_changed'] =
-    InfoBubble.prototype.borderRadius_changed;
+InfoBubble.prototype['borderRadius_changed'] = InfoBubble.prototype.borderRadius_changed;
 
 
 /**
@@ -688,8 +667,8 @@ InfoBubble.prototype['borderRadius_changed'] =
  * @private
  * @return {number} width The width of the border.
  */
-InfoBubble.prototype.getBorderWidth_ = function() {
-  return parseInt(this.get('borderWidth'), 10) || 0;
+InfoBubble.prototype.getBorderWidth_ = function () {
+       return parseInt(this.get('borderWidth'), 10) || 0;
 };
 
 
@@ -698,8 +677,8 @@ InfoBubble.prototype.getBorderWidth_ = function() {
  *
  * @param {number} width The width of the border.
  */
-InfoBubble.prototype.setBorderWidth = function(width) {
-  this.set('borderWidth', width);
+InfoBubble.prototype.setBorderWidth = function (width) {
+       this.set('borderWidth', width);
 };
 InfoBubble.prototype['setBorderWidth'] = InfoBubble.prototype.setBorderWidth;
 
@@ -707,63 +686,60 @@ InfoBubble.prototype['setBorderWidth'] = InfoBubble.prototype.setBorderWidth;
 /**
  * borderWidth change MVC callback
  */
-InfoBubble.prototype.borderWidth_changed = function() {
-  var borderWidth = this.getBorderWidth_();
+InfoBubble.prototype.borderWidth_changed = function () {
+       var borderWidth = this.getBorderWidth_();
 
-  this.contentContainer_.style['borderWidth'] = this.px(borderWidth);
-  this.tabsContainer_.style['top'] = this.px(borderWidth);
+       this.contentContainer_.style['borderWidth'] = this.px(borderWidth);
+       this.tabsContainer_.style['top'] = this.px(borderWidth);
 
-  this.updateArrowStyle_();
-  this.updateTabStyles_();
-  this.borderRadius_changed();
-  this.redraw_();
+       this.updateArrowStyle_();
+       this.updateTabStyles_();
+       this.borderRadius_changed();
+       this.redraw_();
 };
-InfoBubble.prototype['borderWidth_changed'] =
-    InfoBubble.prototype.borderWidth_changed;
+InfoBubble.prototype['borderWidth_changed'] = InfoBubble.prototype.borderWidth_changed;
 
 
 /**
  * Update the arrow style
  * @private
  */
-InfoBubble.prototype.updateArrowStyle_ = function() {
-  var borderWidth = this.getBorderWidth_();
-  var arrowSize = this.getArrowSize_();
-  var arrowStyle = this.getArrowStyle_();
-  var arrowOuterSizePx = this.px(arrowSize);
-  var arrowInnerSizePx = this.px(Math.max(0, arrowSize - borderWidth));
-
-  var outer = this.arrowOuter_;
-  var inner = this.arrowInner_;
+InfoBubble.prototype.updateArrowStyle_ = function () {
+       var borderWidth = this.getBorderWidth_();
+       var arrowSize = this.getArrowSize_();
+       var arrowStyle = this.getArrowStyle_();
+       var arrowOuterSizePx = this.px(arrowSize);
+       var arrowInnerSizePx = this.px(Math.max(0, arrowSize - borderWidth));
 
-  this.arrow_.style['marginTop'] = this.px(-borderWidth);
-  outer.style['borderTopWidth'] = arrowOuterSizePx;
-  inner.style['borderTopWidth'] = arrowInnerSizePx;
+       var outer = this.arrowOuter_;
+       var inner = this.arrowInner_;
 
-  // Full arrow or arrow pointing to the left
-  if (arrowStyle == 0 || arrowStyle == 1) {
-    outer.style['borderLeftWidth'] = arrowOuterSizePx;
-    inner.style['borderLeftWidth'] = arrowInnerSizePx;
-  } else {
-    outer.style['borderLeftWidth'] = inner.style['borderLeftWidth'] = 0;
-  }
+       this.arrow_.style['marginTop'] = this.px(-borderWidth);
+       outer.style['borderTopWidth'] = arrowOuterSizePx;
+       inner.style['borderTopWidth'] = arrowInnerSizePx;
 
-  // Full arrow or arrow pointing to the right
-  if (arrowStyle == 0 || arrowStyle == 2) {
-    outer.style['borderRightWidth'] = arrowOuterSizePx;
-    inner.style['borderRightWidth'] = arrowInnerSizePx;
-  } else {
-    outer.style['borderRightWidth'] = inner.style['borderRightWidth'] = 0;
-  }
-
-  if (arrowStyle < 2) {
-    outer.style['marginLeft'] = this.px(-(arrowSize));
-    inner.style['marginLeft'] = this.px(-(arrowSize - borderWidth));
-  } else {
-    outer.style['marginLeft'] = inner.style['marginLeft'] = 0;
-  }
+       // Full arrow or arrow pointing to the left
+       if (arrowStyle == 0 || arrowStyle == 1) {
+               outer.style['borderLeftWidth'] = arrowOuterSizePx;
+               inner.style['borderLeftWidth'] = arrowInnerSizePx;
+       } else {
+               outer.style['borderLeftWidth'] = inner.style['borderLeftWidth'] = 0;
+       }
 
+       // Full arrow or arrow pointing to the right
+       if (arrowStyle == 0 || arrowStyle == 2) {
+               outer.style['borderRightWidth'] = arrowOuterSizePx;
+               inner.style['borderRightWidth'] = arrowInnerSizePx;
+       } else {
+               outer.style['borderRightWidth'] = inner.style['borderRightWidth'] = 0;
+       }
 
+       if (arrowStyle < 2) {
+               outer.style['marginLeft'] = this.px(-(arrowSize));
+               inner.style['marginLeft'] = this.px(-(arrowSize - borderWidth));
+       } else {
+               outer.style['marginLeft'] = inner.style['marginLeft'] = 0;
+       }
 };
 
 
@@ -772,46 +748,49 @@ InfoBubble.prototype.updateArrowStyle_ = function() {
  *
  * @param {number} padding The padding to apply.
  */
-InfoBubble.prototype.setPadding = function(padding) {
-  this.set('padding', padding);
+InfoBubble.prototype.setPadding = function (padding) {
+       this.set('padding', padding);
 };
 InfoBubble.prototype['setPadding'] = InfoBubble.prototype.setPadding;
 
+
 /**
  * set the padding of the Tab's
  *
  * @param {number} tabPadding The padding to apply to the tab
  */
-InfoBubble.prototype.settabPadding = function(tabPadding) {
-  this.set('tabPadding', tabPadding);
+InfoBubble.prototype.settabPadding = function (tabPadding) {
+       this.set('tabPadding', tabPadding);
 };
 InfoBubble.prototype['settabPadding'] = InfoBubble.prototype.settabPadding;
 
+
 /**
  * Set the padding of the InfoBubble
  *
  * @private
  * @return {number} padding The padding to apply.
  */
-InfoBubble.prototype.getPadding_ = function() {
-  return parseInt(this.get('padding'), 10) || 0;
+InfoBubble.prototype.getPadding_ = function () {
+       return parseInt(this.get('padding'), 10) || 0;
 };
 
-InfoBubble.prototype.gettabPadding_ = function() {
-  return parseInt(this.get('tabPadding'), 10) || 0;
+InfoBubble.prototype.gettabPadding_ = function () {
+       return parseInt(this.get('tabPadding'), 10) || 0;
 };
 
+
 /**
  * padding changed MVC callback
  */
-InfoBubble.prototype.padding_changed = function() {
-  var padding = this.getPadding_();
-  var tabPadding = this.gettabPadding_();
-  this.contentContainer_.style['padding'] = this.px(padding);
-  this.contentContainer_.style['tabPadding'] = this.px(padding);
-  this.updateTabStyles_();
+InfoBubble.prototype.padding_changed = function () {
+       var padding = this.getPadding_();
+       var tabPadding = this.gettabPadding_();
+       this.contentContainer_.style['padding'] = this.px(padding);
+       this.contentContainer_.style['tabPadding'] = this.px(padding);
+       this.updateTabStyles_();
 
-  this.redraw_();
+       this.redraw_();
 };
 InfoBubble.prototype['padding_changed'] = InfoBubble.prototype.padding_changed;
 
@@ -822,12 +801,12 @@ InfoBubble.prototype['padding_changed'] = InfoBubble.prototype.padding_changed;
  * @param {number} num The number to wrap.
  * @return {string|number} A wrapped number.
  */
-InfoBubble.prototype.px = function(num) {
-  if (num) {
-    // 0 doesn't need to be wrapped
-    return num + 'px';
-  }
-  return num;
+InfoBubble.prototype.px = function (num) {
+       if (num) {
+               // 0 doesn't need to be wrapped
+               return num + 'px';
+       }
+       return num;
 };
 
 
@@ -835,24 +814,24 @@ InfoBubble.prototype.px = function(num) {
  * Add events to stop propagation
  * @private
  */
-InfoBubble.prototype.addEvents_ = function() {
-  // We want to cancel all the events so they do not go to the map
-  var events = ['mousedown', 'mousemove', 'mouseover', 'mouseout', 'mouseup',
-      'mousewheel', 'DOMMouseScroll', 'touchstart', 'touchend', 'touchmove',
-      'dblclick', 'contextmenu', 'click'];
+InfoBubble.prototype.addEvents_ = function () {
+       // We want to cancel all the events so they do not go to the map
+       var events = ['mousedown', 'mousemove', 'mouseover', 'mouseout', 'mouseup',
+               'mousewheel', 'DOMMouseScroll', 'touchstart', 'touchend', 'touchmove',
+               'dblclick', 'contextmenu', 'click'];
 
-  var bubble = this.bubble_;
-  this.listeners_ = [];
-  for (var i = 0, event; event = events[i]; i++) {
-    this.listeners_.push(
-      google.maps.event.addDomListener(bubble, event, function(e) {
-        e.cancelBubble = true;
-        if (e.stopPropagation) {
-          e.stopPropagation();
-        }
-      })
-    );
-  }
+       var bubble = this.bubble_;
+       this.listeners_ = [];
+       for (var i = 0, event; event = events[i]; i++) {
+               this.listeners_.push(
+                       google.maps.event.addDomListener(bubble, event, function (e) {
+                               e.cancelBubble = true;
+                               if (e.stopPropagation) {
+                                       e.stopPropagation();
+                               }
+                       })
+               );
+       }
 };
 
 
@@ -860,18 +839,18 @@ InfoBubble.prototype.addEvents_ = function() {
  * On Adding the InfoBubble to a map
  * Implementing the OverlayView interface
  */
-InfoBubble.prototype.onAdd = function() {
-  if (!this.bubble_) {
-    this.buildDom_();
-  }
+InfoBubble.prototype.onAdd = function () {
+       if (!this.bubble_) {
+               this.buildDom_();
+       }
 
-  this.addEvents_();
+       this.addEvents_();
 
-  var panes = this.getPanes();
-  if (panes) {
-    panes.floatPane.appendChild(this.bubble_);
-    panes.floatShadow.appendChild(this.bubbleShadow_);
-  }
+       var panes = /** @type {google.maps.MapPanes} */ this.getPanes();
+       if (panes) {
+               panes.floatPane.appendChild(this.bubble_);
+               panes.floatShadow.appendChild(this.bubbleShadow_);
+       }
 };
 InfoBubble.prototype['onAdd'] = InfoBubble.prototype.onAdd;
 
@@ -880,77 +859,78 @@ InfoBubble.prototype['onAdd'] = InfoBubble.prototype.onAdd;
  * Draw the InfoBubble
  * Implementing the OverlayView interface
  */
-InfoBubble.prototype.draw = function() {
-  var projection = this.getProjection();
-  if (!projection) {
-    // The map projection is not ready yet so do nothing
-    return;
-  }
-
-  var latLng = /** @type {google.maps.LatLng} */ (this.get('position'));
-
-  if (!latLng) {
-    this.close();
-    return;
-  }
-
-  var tabHeight = 0;
-  if (this.activeTab_) {
-    tabHeight = this.activeTab_.offsetHeight;
-  }
-
-  var anchorHeight = this.getAnchorHeight_();
-  var arrowSize = this.getArrowSize_();
-  var arrowPosition = this.getArrowPosition_();
-
-  arrowPosition = arrowPosition / 100;
-
-  var pos = projection.fromLatLngToDivPixel(latLng);
-  var width = this.contentContainer_.offsetWidth;
-  var height = this.bubble_.offsetHeight;
-
-  if (!width) {
-    return;
-  }
-
-  // Adjust for the height of the info bubble
-  var top = pos.y - (height + arrowSize);
-
-  if (anchorHeight) {
-    // If there is an anchor then include the height
-    top -= anchorHeight;
-  }
-
-  var left = pos.x - (width * arrowPosition);
-
-  this.bubble_.style['top'] = this.px(top);
-  this.bubble_.style['left'] = this.px(left);
-
-  var shadowStyle = parseInt(this.get('shadowStyle'), 10);
-
-  switch (shadowStyle) {
-    case 1:
-      // Shadow is behind
-      this.bubbleShadow_.style['top'] = this.px(top + tabHeight - 1);
-      this.bubbleShadow_.style['left'] = this.px(left);
-      this.bubbleShadow_.style['width'] = this.px(width);
-      this.bubbleShadow_.style['height'] =
-          this.px(this.contentContainer_.offsetHeight - arrowSize);
-      break;
-    case 2:
-      // Shadow is below
-      width = width * 0.8;
-      if (anchorHeight) {
-        this.bubbleShadow_.style['top'] = this.px(pos.y);
-      } else {
-        this.bubbleShadow_.style['top'] = this.px(pos.y + arrowSize);
-      }
-      this.bubbleShadow_.style['left'] = this.px(pos.x - width * arrowPosition);
-
-      this.bubbleShadow_.style['width'] = this.px(width);
-      this.bubbleShadow_.style['height'] = this.px(2);
-      break;
-  }
+InfoBubble.prototype.draw = function () {
+       var projection = this.getProjection();
+       if (!projection) {
+               // The map projection is not ready yet so do nothing
+               return;
+       }
+
+       var latLng = /** @type {google.maps.LatLng} */ (this.get('position'));
+
+       if (!latLng) {
+               this.close();
+               return;
+       }
+
+       var tabHeight = 0;
+       if (this.activeTab_) {
+               tabHeight = this.activeTab_.offsetHeight;
+       }
+
+       var anchorHeight = this.getAnchorHeight_();
+       var arrowSize = this.getArrowSize_();
+       var arrowPosition = this.getArrowPosition_();
+
+       arrowPosition = arrowPosition / 100;
+
+       var pos = projection.fromLatLngToDivPixel(latLng);
+       var width = this.contentContainer_.offsetWidth;
+       var height = this.bubble_.offsetHeight;
+
+       if (!width) {
+               return;
+       }
+
+       // Adjust for the height of the info bubble
+       var top = pos.y - (height + arrowSize);
+
+       if (anchorHeight) {
+               // If there is an anchor then include the height
+               top -= anchorHeight;
+       }
+
+       var left = pos.x - (width * arrowPosition);
+
+       this.bubble_.style['top'] = this.px(top);
+       this.bubble_.style['left'] = this.px(left);
+
+       var shadowStyle = parseInt(this.get('shadowStyle'), 10);
+
+       switch (shadowStyle) {
+               case 1:
+                       // Shadow is behind
+                       this.bubbleShadow_.style['top'] = this.px(top + tabHeight - 1);
+                       this.bubbleShadow_.style['left'] = this.px(left);
+                       this.bubbleShadow_.style['width'] = this.px(width);
+                       this.bubbleShadow_.style['height'] =
+                               this.px(this.contentContainer_.offsetHeight - arrowSize);
+                       break;
+
+               case 2:
+                       // Shadow is below
+                       width = width * 0.8;
+                       if (anchorHeight) {
+                               this.bubbleShadow_.style['top'] = this.px(pos.y);
+                       } else {
+                               this.bubbleShadow_.style['top'] = this.px(pos.y + arrowSize);
+                       }
+                       this.bubbleShadow_.style['left'] = this.px(pos.x - width * arrowPosition);
+
+                       this.bubbleShadow_.style['width'] = this.px(width);
+                       this.bubbleShadow_.style['height'] = this.px(2);
+                       break;
+       }
 };
 InfoBubble.prototype['draw'] = InfoBubble.prototype.draw;
 
@@ -958,17 +938,17 @@ InfoBubble.prototype['draw'] = InfoBubble.prototype.draw;
 /**
  * Removing the InfoBubble from a map
  */
-InfoBubble.prototype.onRemove = function() {
-  if (this.bubble_ && this.bubble_.parentNode) {
-    this.bubble_.parentNode.removeChild(this.bubble_);
-  }
-  if (this.bubbleShadow_ && this.bubbleShadow_.parentNode) {
-    this.bubbleShadow_.parentNode.removeChild(this.bubbleShadow_);
-  }
+InfoBubble.prototype.onRemove = function () {
+       if (this.bubble_ && this.bubble_.parentNode) {
+               this.bubble_.parentNode.removeChild(this.bubble_);
+       }
+       if (this.bubbleShadow_ && this.bubbleShadow_.parentNode) {
+               this.bubbleShadow_.parentNode.removeChild(this.bubbleShadow_);
+       }
 
-  for (var i = 0, listener; listener = this.listeners_[i]; i++) {
-    google.maps.event.removeListener(listener);
-  }
+       for (var i = 0, listener; listener = this.listeners_[i]; i++) {
+               google.maps.event.removeListener(listener);
+       }
 };
 InfoBubble.prototype['onRemove'] = InfoBubble.prototype.onRemove;
 
@@ -978,8 +958,8 @@ InfoBubble.prototype['onRemove'] = InfoBubble.prototype.onRemove;
  *
  * @return {boolean} If the InfoBubble is open.
  */
-InfoBubble.prototype.isOpen = function() {
-  return this.isOpen_;
+InfoBubble.prototype.isOpen = function () {
+       return this.isOpen_;
 };
 InfoBubble.prototype['isOpen'] = InfoBubble.prototype.isOpen;
 
@@ -987,20 +967,20 @@ InfoBubble.prototype['isOpen'] = InfoBubble.prototype.isOpen;
 /**
  * Close the InfoBubble
  */
-InfoBubble.prototype.close = function() {
-  if (this.bubble_) {
-    this.bubble_.style['display'] = 'none';
-    // Remove the animation so we next time it opens it will animate again
-    this.bubble_.className =
-        this.bubble_.className.replace(this.animationName_, '');
-  }
-
-  if (this.bubbleShadow_) {
-    this.bubbleShadow_.style['display'] = 'none';
-    this.bubbleShadow_.className =
-        this.bubbleShadow_.className.replace(this.animationName_, '');
-  }
-  this.isOpen_ = false;
+InfoBubble.prototype.close = function () {
+       if (this.bubble_) {
+               this.bubble_.style['display'] = 'none';
+               // Remove the animation so we next time it opens it will animate again
+               this.bubble_.className =
+                       this.bubble_.className.replace(this.animationName_, '');
+       }
+
+       if (this.bubbleShadow_) {
+               this.bubbleShadow_.style['display'] = 'none';
+               this.bubbleShadow_.className =
+                       this.bubbleShadow_.className.replace(this.animationName_, '');
+       }
+       this.isOpen_ = false;
 };
 InfoBubble.prototype['close'] = InfoBubble.prototype.close;
 
@@ -1008,56 +988,56 @@ InfoBubble.prototype['close'] = InfoBubble.prototype.close;
 /**
  * Open the InfoBubble (asynchronous).
  *
- * @param {google.maps.Map=} opt_map Optional map to open on.
- * @param {google.maps.MVCObject=} opt_anchor Optional anchor to position at.
+ * @param {google.maps.Map} opt_map Optional map to open on.
+ * @param {google.maps.MVCObject} opt_anchor Optional anchor to position at.
  */
-InfoBubble.prototype.open = function(opt_map, opt_anchor) {
-  var that = this;
-  window.setTimeout(function() {
-    that.open_(opt_map, opt_anchor);
-  }, 0);
+InfoBubble.prototype.open = function (opt_map, opt_anchor) {
+       var that = this;
+       window.setTimeout(function () {
+               that.open_(opt_map, opt_anchor);
+       }, 0);
 };
 
 /**
  * Open the InfoBubble
  * @private
- * @param {google.maps.Map=} opt_map Optional map to open on.
- * @param {google.maps.MVCObject=} opt_anchor Optional anchor to position at.
- */
-InfoBubble.prototype.open_ = function(opt_map, opt_anchor) {
-  this.updateContent_();
-
-  if (opt_map) {
-    this.setMap(opt_map);
-  }
-
-  if (opt_anchor) {
-    this.set('anchor', opt_anchor);
-    this.bindTo('anchorPoint', opt_anchor);
-    this.bindTo('position', opt_anchor);
-  }
-
-  // Show the bubble and the show
-  this.bubble_.style['display'] = this.bubbleShadow_.style['display'] = '';
-  var animation = !this.get('disableAnimation');
-
-  if (animation) {
-    // Add the animation
-    this.bubble_.className += ' ' + this.animationName_;
-    this.bubbleShadow_.className += ' ' + this.animationName_;
-  }
-
-  this.redraw_();
-  this.isOpen_ = true;
-
-  var pan = !this.get('disableAutoPan');
-  if (pan) {
-    var that = this;
-    window.setTimeout(function() {
-      // Pan into view, done in a time out to make it feel nicer :)
-      that.panToView();
-    }, 200);
-  }
+ * @param {google.maps.Map} opt_map Optional map to open on.
+ * @param {google.maps.MVCObject} opt_anchor Optional anchor to position at.
+ */
+InfoBubble.prototype.open_ = function (opt_map, opt_anchor) {
+       this.updateContent_();
+
+       if (opt_map) {
+               this.setMap(opt_map);
+       }
+
+       if (opt_anchor) {
+               this.set('anchor', opt_anchor);
+               this.bindTo('anchorPoint', opt_anchor);
+               this.bindTo('position', opt_anchor);
+       }
+
+       // Show the bubble and the show
+       this.bubble_.style['display'] = this.bubbleShadow_.style['display'] = '';
+       var animation = !this.get('disableAnimation');
+
+       if (animation) {
+               // Add the animation
+               this.bubble_.className += ' ' + this.animationName_;
+               this.bubbleShadow_.className += ' ' + this.animationName_;
+       }
+
+       this.redraw_();
+       this.isOpen_ = true;
+
+       var pan = !this.get('disableAutoPan');
+       if (pan) {
+               var that = this;
+               window.setTimeout(function () {
+                       // Pan into view, done in a time out to make it feel nicer :)
+                       that.panToView();
+               }, 200);
+       }
 };
 InfoBubble.prototype['open'] = InfoBubble.prototype.open;
 
@@ -1067,10 +1047,10 @@ InfoBubble.prototype['open'] = InfoBubble.prototype.open;
  *
  * @param {google.maps.LatLng} position The position to set.
  */
-InfoBubble.prototype.setPosition = function(position) {
-  if (position) {
-    this.set('position', position);
-  }
+InfoBubble.prototype.setPosition = function (position) {
+       if (position) {
+               this.set('position', position);
+       }
 };
 InfoBubble.prototype['setPosition'] = InfoBubble.prototype.setPosition;
 
@@ -1080,8 +1060,8 @@ InfoBubble.prototype['setPosition'] = InfoBubble.prototype.setPosition;
  *
  * @return {google.maps.LatLng} the position.
  */
-InfoBubble.prototype.getPosition = function() {
-  return /** @type {google.maps.LatLng} */ (this.get('position'));
+InfoBubble.prototype.getPosition = function () {
+       return /** @type {google.maps.LatLng} */ (this.get('position'));
 };
 InfoBubble.prototype['getPosition'] = InfoBubble.prototype.getPosition;
 
@@ -1089,59 +1069,58 @@ InfoBubble.prototype['getPosition'] = InfoBubble.prototype.getPosition;
 /**
  * position changed MVC callback
  */
-InfoBubble.prototype.position_changed = function() {
-  this.draw();
+InfoBubble.prototype.position_changed = function () {
+       this.draw();
 };
-InfoBubble.prototype['position_changed'] =
-    InfoBubble.prototype.position_changed;
+InfoBubble.prototype['position_changed'] = InfoBubble.prototype.position_changed;
 
 
 /**
  * Pan the InfoBubble into view
  */
-InfoBubble.prototype.panToView = function() {
-  var projection = this.getProjection();
+InfoBubble.prototype.panToView = function () {
+       var projection = this.getProjection();
 
-  if (!projection) {
-    // The map projection is not ready yet so do nothing
-    return;
-  }
+       if (!projection) {
+               // The map projection is not ready yet so do nothing
+               return;
+       }
 
-  if (!this.bubble_) {
-    // No Bubble yet so do nothing
-    return;
-  }
+       if (!this.bubble_) {
+               // No Bubble yet so do nothing
+               return;
+       }
 
-  var anchorHeight = this.getAnchorHeight_();
-  var height = this.bubble_.offsetHeight + anchorHeight;
-  var map = this.get('map');
-  var mapDiv = map.getDiv();
-  var mapHeight = mapDiv.offsetHeight;
+       var anchorHeight = this.getAnchorHeight_();
+       var height = this.bubble_.offsetHeight + anchorHeight;
+       var map = this.get('map');
+       var mapDiv = map.getDiv();
+       var mapHeight = mapDiv.offsetHeight;
 
-  var latLng = this.getPosition();
-  var centerPos = projection.fromLatLngToContainerPixel(map.getCenter());
-  var pos = projection.fromLatLngToContainerPixel(latLng);
+       var latLng = this.getPosition();
+       var centerPos = projection.fromLatLngToContainerPixel(map.getCenter());
+       var pos = projection.fromLatLngToContainerPixel(latLng);
 
-  // Find out how much space at the top is free
-  var spaceTop = centerPos.y - height;
+       // Find out how much space at the top is free
+       var spaceTop = centerPos.y - height;
 
-  // Fine out how much space at the bottom is free
-  var spaceBottom = mapHeight - centerPos.y;
+       // Fine out how much space at the bottom is free
+       var spaceBottom = mapHeight - centerPos.y;
 
-  var needsTop = spaceTop < 0;
-  var deltaY = 0;
+       var needsTop = spaceTop < 0;
+       var deltaY = 0;
 
-  if (needsTop) {
-    spaceTop *= -1;
-    deltaY = (spaceTop + spaceBottom) / 2;
-  }
+       if (needsTop) {
+               spaceTop *= -1;
+               deltaY = (spaceTop + spaceBottom) / 2;
+       }
 
-  pos.y -= deltaY;
-  latLng = projection.fromContainerPixelToLatLng(pos);
+       pos.y -= deltaY;
+       latLng = projection.fromContainerPixelToLatLng(pos);
 
-  if (map.getCenter() != latLng) {
-    map.panTo(latLng);
-  }
+       if (map.getCenter() != latLng) {
+               map.panTo(latLng);
+       }
 };
 InfoBubble.prototype['panToView'] = InfoBubble.prototype.panToView;
 
@@ -1153,19 +1132,19 @@ InfoBubble.prototype['panToView'] = InfoBubble.prototype.panToView;
  * @return {Node} A HTML document fragment.
  * @private
  */
-InfoBubble.prototype.htmlToDocumentFragment_ = function(htmlString) {
-  htmlString = htmlString.replace(/^\s*([\S\s]*)\b\s*$/, '$1');
-  var tempDiv = document.createElement('DIV');
-  tempDiv.innerHTML = htmlString;
-  if (tempDiv.childNodes.length == 1) {
-    return /** @type {!Node} */ (tempDiv.removeChild(tempDiv.firstChild));
-  } else {
-    var fragment = document.createDocumentFragment();
-    while (tempDiv.firstChild) {
-      fragment.appendChild(tempDiv.firstChild);
-    }
-    return fragment;
-  }
+InfoBubble.prototype.htmlToDocumentFragment_ = function (htmlString) {
+       htmlString = htmlString.replace(/^\s*([\S\s]*)\b\s*$/, '$1');
+       var tempDiv = document.createElement('DIV');
+       tempDiv.innerHTML = htmlString;
+       if (tempDiv.childNodes.length == 1) {
+               return /** @type {Node} */ (tempDiv.removeChild(tempDiv.firstChild));
+       } else {
+               var fragment = document.createDocumentFragment();
+               while (tempDiv.firstChild) {
+                       fragment.appendChild(tempDiv.firstChild);
+               }
+               return fragment;
+       }
 };
 
 
@@ -1175,25 +1154,25 @@ InfoBubble.prototype.htmlToDocumentFragment_ = function(htmlString) {
  * @param {Node} node The node to remove all children from.
  * @private
  */
-InfoBubble.prototype.removeChildren_ = function(node) {
-  if (!node) {
-    return;
-  }
+InfoBubble.prototype.removeChildren_ = function (node) {
+       if (!node) {
+               return;
+       }
 
-  var child;
-  while (child = node.firstChild) {
-    node.removeChild(child);
-  }
+       var child;
+       while (child = node.firstChild) {
+               node.removeChild(child);
+       }
 };
 
 
 /**
  * Sets the content of the infobubble.
  *
- * @param {string|Node} content The content to set.
+ * @param {Node|string} content The content to set.
  */
-InfoBubble.prototype.setContent = function(content) {
-  this.set('content', content);
+InfoBubble.prototype.setContent = function (content) {
+       this.set('content', content);
 };
 InfoBubble.prototype['setContent'] = InfoBubble.prototype.setContent;
 
@@ -1201,10 +1180,10 @@ InfoBubble.prototype['setContent'] = InfoBubble.prototype.setContent;
 /**
  * Get the content of the infobubble.
  *
- * @return {string|Node} The marker content.
+ * @return {Node|string} The marker content.
  */
-InfoBubble.prototype.getContent = function() {
-  return /** @type {Node|string} */ (this.get('content'));
+InfoBubble.prototype.getContent = function () {
+       return this.get('content');
 };
 InfoBubble.prototype['getContent'] = InfoBubble.prototype.getContent;
 
@@ -1212,115 +1191,123 @@ InfoBubble.prototype['getContent'] = InfoBubble.prototype.getContent;
 /**
  * Sets the marker content and adds loading events to images
  */
-InfoBubble.prototype.updateContent_ = function() {
-  if (!this.content_) {
-    // The Content area doesnt exist.
-    return;
-  }
-
-  this.removeChildren_(this.content_);
-  var content = this.getContent();
-  if (content) {
-    if (typeof content == 'string') {
-      content = this.htmlToDocumentFragment_(content);
-    }
-    this.content_.appendChild(content);
-
-    var that = this;
-    var images = this.content_.getElementsByTagName('IMG');
-    for (var i = 0, image; image = images[i]; i++) {
-      // Because we don't know the size of an image till it loads, add a
-      // listener to the image load so the marker can resize and reposition
-      // itself to be the correct height.
-      google.maps.event.addDomListener(image, 'load', function() {
-        that.imageLoaded_();
-      });
-    }
-    google.maps.event.trigger(this, 'domready');
-  }
-  this.redraw_();
+InfoBubble.prototype.updateContent_ = function () {
+       if (!this.content_) {
+               // The Content area doesnt exist.
+               return;
+       }
+
+       this.removeChildren_(this.content_);
+       var content = this.getContent();
+       if (content) {
+               if (typeof content == 'string') {
+                       content = this.htmlToDocumentFragment_(content);
+               }
+               this.content_.appendChild(content);
+
+               var that = this;
+               var images = this.content_.getElementsByTagName('IMG');
+               for (var i = 0, image; image = images[i]; i++) {
+                       // Because we don't know the size of an image till it loads, add a
+                       // listener to the image load so the marker can resize and reposition
+                       // itself to be the correct height.
+                       google.maps.event.addDomListener(image, 'load', function () {
+                               that.imageLoaded_();
+                       });
+               }
+               google.maps.event.trigger(this, 'domready');
+       }
+       this.redraw_();
 };
 
+
 /**
  * Image loaded
+ *
  * @private
  */
-InfoBubble.prototype.imageLoaded_ = function() {
-  var pan = !this.get('disableAutoPan');
-  this.redraw_();
-  if (pan && (this.tabs_.length == 0 || this.activeTab_.index == 0)) {
-    this.panToView();
-  }
+InfoBubble.prototype.imageLoaded_ = function () {
+       var pan = !this.get('disableAutoPan');
+       this.redraw_();
+       if (pan && (this.tabs_.length == 0 || this.activeTab_.index == 0)) {
+               this.panToView();
+       }
 };
 
+
 /**
  * Updates the styles of the tabs
+ *
  * @private
  */
-InfoBubble.prototype.updateTabStyles_ = function() {
-  if (this.tabs_ && this.tabs_.length) {
-    for (var i = 0, tab; tab = this.tabs_[i]; i++) {
-      this.setTabStyle_(tab.tab);
-    }
-    this.activeTab_.style['zIndex'] = this.baseZIndex_;
-    var borderWidth = this.getBorderWidth_();
-    var padding = this.gettabPadding_() / 2;
-    this.activeTab_.style['borderBottomWidth'] = 0;
-    this.activeTab_.style['paddingBottom'] = this.px(padding + borderWidth);
-  }
+InfoBubble.prototype.updateTabStyles_ = function () {
+       if (this.tabs_ && this.tabs_.length) {
+               for (var i = 0, tab; tab = this.tabs_[i]; i++) {
+                       this.setTabStyle_(tab.tab);
+               }
+               this.activeTab_.style['zIndex'] = this.baseZIndex_;
+               var borderWidth = this.getBorderWidth_();
+               var padding = this.gettabPadding_() / 2;
+               this.activeTab_.style['borderBottomWidth'] = 0;
+               this.activeTab_.style['paddingBottom'] = this.px(padding + borderWidth);
+       }
 };
 
 
 /**
  * Sets the style of a tab
+ *
  * @private
- * @param {Element} tab The tab to style.
- */
-InfoBubble.prototype.setTabStyle_ = function(tab) {
-  var backgroundColor = this.get('backgroundColor');
-  var borderColor = this.get('borderColor');
-  var borderRadius = this.getBorderRadius_();
-  var borderWidth = this.getBorderWidth_();
-  var padding = this.gettabPadding_();
-
-  var marginRight = this.px(-(Math.max(padding, borderRadius)/2));
-  console.log(marginRight);
-  var borderRadiusPx = this.px(borderRadius);
-
-  var index = this.baseZIndex_;
-  if (tab.index) {
-    index -= tab.index;
-  }
-  // The styles for the tab
-  var styles = {
-    'cssFloat': 'left',
-    'position': 'relative',
-    'cursor': 'pointer',
-    'backgroundColor': backgroundColor,
-    'border': this.px(borderWidth) + ' solid ' + borderColor,
-    'padding': this.px(padding / 2) + ' ' + this.px(padding),
-    'marginRight': marginRight,
-    'whiteSpace': 'nowrap',
-    'borderRadiusTopLeft': borderRadiusPx,
-    'MozBorderRadiusTopleft': borderRadiusPx,
-    'webkitBorderTopLeftRadius': borderRadiusPx,
-    'borderRadiusTopRight': borderRadiusPx,
-    'MozBorderRadiusTopright': borderRadiusPx,
-    'webkitBorderTopRightRadius': borderRadiusPx,
-    'zIndex': index,
-    'display': 'inline'
-  };
-
-  for (var style in styles) {
-    tab.style[style] = styles[style];
-  }
-
-  var className = this.get('tabClassName');
-
-  if (className != undefined) {
-    tab.className += ' ' + className;
-  }
-  console.log(this);
+ * @param {HTMLElement} tab The tab to style.
+ */
+InfoBubble.prototype.setTabStyle_ = function (tab) {
+       var backgroundColor = this.get('backgroundColor');
+       var borderColor = this.get('borderColor');
+       var borderRadius = this.getBorderRadius_();
+       var borderWidth = this.getBorderWidth_();
+       var padding = this.gettabPadding_();
+
+       var marginRight = this.px(-(Math.max(padding, borderRadius) / 2));
+       console.log(marginRight);
+       var borderRadiusPx = this.px(borderRadius);
+
+       var index = this.baseZIndex_;
+       if (tab.index) {
+               index -= tab.index;
+       }
+       // The styles for the tab
+       var styles = {
+               'cssFloat': 'left',
+               'position': 'relative',
+               'cursor': 'pointer',
+               'backgroundColor': backgroundColor,
+               'border': this.px(borderWidth) + ' solid ' + borderColor,
+               'padding': this.px(padding / 2) + ' ' + this.px(padding),
+               'marginRight': marginRight,
+               'whiteSpace': 'nowrap',
+               'borderRadiusTopLeft': borderRadiusPx,
+               'MozBorderRadiusTopleft': borderRadiusPx,
+               'webkitBorderTopLeftRadius': borderRadiusPx,
+               'borderRadiusTopRight': borderRadiusPx,
+               'MozBorderRadiusTopright': borderRadiusPx,
+               'webkitBorderTopRightRadius': borderRadiusPx,
+               'zIndex': index,
+               'display': 'inline'
+       };
+
+       var style;
+       for (style in styles) {
+               if (styles.hasOwnProperty(style) && tab.style.hasOwnProperty(style)) {
+                       tab.style[style] = styles[style];
+               }
+       }
+
+       var className = this.get('tabClassName');
+
+       if (className != undefined) {
+               tab.className += ' ' + className;
+       }
+       console.log(this);
 };
 
 
@@ -1329,11 +1316,11 @@ InfoBubble.prototype.setTabStyle_ = function(tab) {
  * @private
  * @param {Object} tab The tab to add the actions to.
  */
-InfoBubble.prototype.addTabActions_ = function(tab) {
-  var that = this;
-  tab.listener_ = google.maps.event.addDomListener(tab, 'click', function() {
-    that.setTabActive_(this);
-  });
+InfoBubble.prototype.addTabActions_ = function (tab) {
+       var that = this;
+       tab.listener_ = google.maps.event.addDomListener(tab, 'click', function () {
+               that.setTabActive_(this);
+       });
 };
 
 
@@ -1342,12 +1329,12 @@ InfoBubble.prototype.addTabActions_ = function(tab) {
  *
  * @param {number} index The index of the tab.
  */
-InfoBubble.prototype.setTabActive = function(index) {
-  var tab = this.tabs_[index - 1];
+InfoBubble.prototype.setTabActive = function (index) {
+       var tab = this.tabs_[index - 1];
 
-  if (tab) {
-    this.setTabActive_(tab.tab);
-  }
+       if (tab) {
+               this.setTabActive_(tab.tab);
+       }
 };
 InfoBubble.prototype['setTabActive'] = InfoBubble.prototype.setTabActive;
 
@@ -1357,35 +1344,35 @@ InfoBubble.prototype['setTabActive'] = InfoBubble.prototype.setTabActive;
  * @private
  * @param {Object} tab The tab to set active.
  */
-InfoBubble.prototype.setTabActive_ = function(tab) {
-  if (!tab) {
-    this.setContent('');
-    this.updateContent_();
-    return;
-  }
+InfoBubble.prototype.setTabActive_ = function (tab) {
+       if (!tab) {
+               this.setContent('');
+               this.updateContent_();
+               return;
+       }
 
-  var padding = this.gettabPadding_() / 2;
-  var borderWidth = this.getBorderWidth_();
+       var padding = this.gettabPadding_() / 2;
+       var borderWidth = this.getBorderWidth_();
 
-  if (this.activeTab_) {
-    var activeTab = this.activeTab_;
-    activeTab.className = this.tabClassName;
-    activeTab.style['zIndex'] = this.baseZIndex_ - activeTab.index;
-    activeTab.style['paddingBottom'] = this.px(padding);
-    activeTab.style['borderBottomWidth'] = this.px(borderWidth);
-  }
-  tab.className = this.activeTabClassName;
-  tab.style['zIndex'] = this.baseZIndex_;
-  tab.style['borderBottomWidth'] = 0;
-  tab.style['marginBottomWidth'] = '-10px';
-  tab.style['paddingBottom'] = this.px(padding + borderWidth);
+       if (this.activeTab_) {
+               var activeTab = this.activeTab_;
+               activeTab.className = this.get('tabClassName');
+               activeTab.style['zIndex'] = this.baseZIndex_ - activeTab.index;
+               activeTab.style['paddingBottom'] = this.px(padding);
+               activeTab.style['borderBottomWidth'] = this.px(borderWidth);
+       }
+       tab.className = this.activeTabClassName;
+       tab.style['zIndex'] = this.baseZIndex_;
+       tab.style['borderBottomWidth'] = 0;
+       tab.style['marginBottomWidth'] = '-10px';
+       tab.style['paddingBottom'] = this.px(padding + borderWidth);
 
-  this.setContent(this.tabs_[tab.index].content);
-  this.updateContent_();
+       this.setContent(this.tabs_[tab.index].content);
+       this.updateContent_();
 
-  this.activeTab_ = tab;
+       this.activeTab_ = tab;
 
-  this.redraw_();
+       this.redraw_();
 };
 
 
@@ -1394,8 +1381,8 @@ InfoBubble.prototype.setTabActive_ = function(tab) {
  *
  * @param {number} width The max width.
  */
-InfoBubble.prototype.setMaxWidth = function(width) {
-  this.set('maxWidth', width);
+InfoBubble.prototype.setMaxWidth = function (width) {
+       this.set('maxWidth', width);
 };
 InfoBubble.prototype['setMaxWidth'] = InfoBubble.prototype.setMaxWidth;
 
@@ -1403,11 +1390,10 @@ InfoBubble.prototype['setMaxWidth'] = InfoBubble.prototype.setMaxWidth;
 /**
  * maxWidth changed MVC callback
  */
-InfoBubble.prototype.maxWidth_changed = function() {
-  this.redraw_();
+InfoBubble.prototype.maxWidth_changed = function () {
+       this.redraw_();
 };
-InfoBubble.prototype['maxWidth_changed'] =
-    InfoBubble.prototype.maxWidth_changed;
+InfoBubble.prototype['maxWidth_changed'] = InfoBubble.prototype.maxWidth_changed;
 
 
 /**
@@ -1415,8 +1401,8 @@ InfoBubble.prototype['maxWidth_changed'] =
  *
  * @param {number} height The max height.
  */
-InfoBubble.prototype.setMaxHeight = function(height) {
-  this.set('maxHeight', height);
+InfoBubble.prototype.setMaxHeight = function (height) {
+       this.set('maxHeight', height);
 };
 InfoBubble.prototype['setMaxHeight'] = InfoBubble.prototype.setMaxHeight;
 
@@ -1424,11 +1410,10 @@ InfoBubble.prototype['setMaxHeight'] = InfoBubble.prototype.setMaxHeight;
 /**
  * maxHeight changed MVC callback
  */
-InfoBubble.prototype.maxHeight_changed = function() {
-  this.redraw_();
+InfoBubble.prototype.maxHeight_changed = function () {
+       this.redraw_();
 };
-InfoBubble.prototype['maxHeight_changed'] =
-    InfoBubble.prototype.maxHeight_changed;
+InfoBubble.prototype['maxHeight_changed'] = InfoBubble.prototype.maxHeight_changed;
 
 
 /**
@@ -1436,8 +1421,8 @@ InfoBubble.prototype['maxHeight_changed'] =
  *
  * @param {number} width The min width.
  */
-InfoBubble.prototype.setMinWidth = function(width) {
-  this.set('minWidth', width);
+InfoBubble.prototype.setMinWidth = function (width) {
+       this.set('minWidth', width);
 };
 InfoBubble.prototype['setMinWidth'] = InfoBubble.prototype.setMinWidth;
 
@@ -1445,11 +1430,10 @@ InfoBubble.prototype['setMinWidth'] = InfoBubble.prototype.setMinWidth;
 /**
  * minWidth changed MVC callback
  */
-InfoBubble.prototype.minWidth_changed = function() {
-  this.redraw_();
+InfoBubble.prototype.minWidth_changed = function () {
+       this.redraw_();
 };
-InfoBubble.prototype['minWidth_changed'] =
-    InfoBubble.prototype.minWidth_changed;
+InfoBubble.prototype['minWidth_changed'] = InfoBubble.prototype.minWidth_changed;
 
 
 /**
@@ -1457,8 +1441,8 @@ InfoBubble.prototype['minWidth_changed'] =
  *
  * @param {number} height The min height.
  */
-InfoBubble.prototype.setMinHeight = function(height) {
-  this.set('minHeight', height);
+InfoBubble.prototype.setMinHeight = function (height) {
+       this.set('minHeight', height);
 };
 InfoBubble.prototype['setMinHeight'] = InfoBubble.prototype.setMinHeight;
 
@@ -1466,11 +1450,10 @@ InfoBubble.prototype['setMinHeight'] = InfoBubble.prototype.setMinHeight;
 /**
  * minHeight changed MVC callback
  */
-InfoBubble.prototype.minHeight_changed = function() {
-  this.redraw_();
+InfoBubble.prototype.minHeight_changed = function () {
+       this.redraw_();
 };
-InfoBubble.prototype['minHeight_changed'] =
-    InfoBubble.prototype.minHeight_changed;
+InfoBubble.prototype['minHeight_changed'] = InfoBubble.prototype.minHeight_changed;
 
 
 /**
@@ -1479,34 +1462,35 @@ InfoBubble.prototype['minHeight_changed'] =
  * @param {string} label The label of the tab.
  * @param {string|Element} content The content of the tab.
  */
-InfoBubble.prototype.addTab = function(label, content) {
-  var tab = document.createElement('DIV');
-  tab.innerHTML = label;
+InfoBubble.prototype.addTab = function (label, content) {
+       var tab = document.createElement('DIV');
+       tab.innerHTML = label;
 
-  this.setTabStyle_(tab);
-  this.addTabActions_(tab);
+       this.setTabStyle_(tab);
+       this.addTabActions_(tab);
 
-  this.tabsContainer_.appendChild(tab);
+       this.tabsContainer_.appendChild(tab);
 
-  this.tabs_.push({
-    label: label,
-    content: content,
-    tab: tab
-  });
+       this.tabs_.push({
+               label: label,
+               content: content,
+               tab: tab
+       });
 
-  tab.index = this.tabs_.length - 1;
-  tab.style['zIndex'] = this.baseZIndex_ - tab.index;
+       tab.index = this.tabs_.length - 1;
+       tab.style['zIndex'] = this.baseZIndex_ - tab.index;
 
-  if (!this.activeTab_) {
-    this.setTabActive_(tab);
-  }
+       if (!this.activeTab_) {
+               this.setTabActive_(tab);
+       }
 
-  tab.className = tab.className + ' ' + this.animationName_;
+       tab.className = tab.className + ' ' + this.animationName_;
 
-  this.redraw_();
+       this.redraw_();
 };
 InfoBubble.prototype['addTab'] = InfoBubble.prototype.addTab;
 
+
 /**
  * Update a tab at a speicifc index
  *
@@ -1514,25 +1498,25 @@ InfoBubble.prototype['addTab'] = InfoBubble.prototype.addTab;
  * @param {?string} opt_label The label to change to.
  * @param {?string} opt_content The content to update to.
  */
-InfoBubble.prototype.updateTab = function(index, opt_label, opt_content) {
-  if (!this.tabs_.length || index < 0 || index >= this.tabs_.length) {
-    return;
-  }
+InfoBubble.prototype.updateTab = function (index, opt_label, opt_content) {
+       if (!this.tabs_.length || index < 0 || index >= this.tabs_.length) {
+               return;
+       }
 
-  var tab = this.tabs_[index];
-  if (opt_label != undefined) {
-    tab.tab.innerHTML = tab.label = opt_label;
-  }
+       var tab = this.tabs_[index];
+       if (opt_label != undefined) {
+               tab.tab.innerHTML = tab.label = opt_label;
+       }
 
-  if (opt_content != undefined) {
-    tab.content = opt_content;
-  }
+       if (opt_content != undefined) {
+               tab.content = opt_content;
+       }
 
-  if (this.activeTab_ == tab.tab) {
-    this.setContent(tab.content);
-    this.updateContent_();
-  }
-  this.redraw_();
+       if (this.activeTab_ == tab.tab) {
+               this.setContent(tab.content);
+               this.updateContent_();
+       }
+       this.redraw_();
 };
 InfoBubble.prototype['updateTab'] = InfoBubble.prototype.updateTab;
 
@@ -1542,41 +1526,41 @@ InfoBubble.prototype['updateTab'] = InfoBubble.prototype.updateTab;
  *
  * @param {number} index The index of the tab to remove.
  */
-InfoBubble.prototype.removeTab = function(index) {
-  if (!this.tabs_.length || index < 0 || index >= this.tabs_.length) {
-    return;
-  }
+InfoBubble.prototype.removeTab = function (index) {
+       if (!this.tabs_.length || index < 0 || index >= this.tabs_.length) {
+               return;
+       }
 
-  var tab = this.tabs_[index];
-  tab.tab.parentNode.removeChild(tab.tab);
+       var tab = this.tabs_[index];
+       tab.tab.parentNode.removeChild(tab.tab);
 
-  google.maps.event.removeListener(tab.tab.listener_);
+       google.maps.event.removeListener(tab.tab.listener_);
 
-  this.tabs_.splice(index, 1);
+       this.tabs_.splice(index, 1);
 
-  delete tab;
+       tab.parentNode.removeChild(tab);
 
-  for (var i = 0, t; t = this.tabs_[i]; i++) {
-    t.tab.index = i;
-  }
+       for (var i = 0, t; t = this.tabs_[i]; i++) {
+               t.tab.index = i;
+       }
 
-  if (tab.tab == this.activeTab_) {
-    // Removing the current active tab
-    if (this.tabs_[index]) {
-      // Show the tab to the right
-      this.activeTab_ = this.tabs_[index].tab;
-    } else if (this.tabs_[index - 1]) {
-      // Show a tab to the left
-      this.activeTab_ = this.tabs_[index - 1].tab;
-    } else {
-      // No tabs left to sho
-      this.activeTab_ = undefined;
-    }
+       if (tab.tab == this.activeTab_) {
+               // Removing the current active tab
+               if (this.tabs_[index]) {
+                       // Show the tab to the right
+                       this.activeTab_ = this.tabs_[index].tab;
+               } else if (this.tabs_[index - 1]) {
+                       // Show a tab to the left
+                       this.activeTab_ = this.tabs_[index - 1].tab;
+               } else {
+                       // No tabs left to sho
+                       this.activeTab_ = undefined;
+               }
 
-    this.setTabActive_(this.activeTab_);
-  }
+               this.setTabActive_(this.activeTab_);
+       }
 
-  this.redraw_();
+       this.redraw_();
 };
 InfoBubble.prototype['removeTab'] = InfoBubble.prototype.removeTab;
 
@@ -1589,38 +1573,36 @@ InfoBubble.prototype['removeTab'] = InfoBubble.prototype.removeTab;
  * @param {number=} opt_maxHeight Optional max height of the element.
  * @return {google.maps.Size} The size of the element.
  */
-InfoBubble.prototype.getElementSize_ = function(element, opt_maxWidth,
-                                                opt_maxHeight) {
-  var sizer = document.createElement('DIV');
-  sizer.style['display'] = 'inline';
-  sizer.style['position'] = 'absolute';
-  sizer.style['visibility'] = 'hidden';
+InfoBubble.prototype.getElementSize_ = function (element, opt_maxWidth, opt_maxHeight) {
+       var sizer = /** @type {Element} */ document.createElement('DIV');
+       sizer.style['display'] = 'inline';
+       sizer.style['position'] = 'absolute';
+       sizer.style['visibility'] = 'hidden';
 
-  if (typeof element == 'string') {
-    sizer.innerHTML = element;
-  } else {
-    sizer.appendChild(element.cloneNode(true));
-  }
+       if (typeof element == 'string') {
+               sizer.innerHTML = element;
+       } else {
+               sizer.appendChild(element.cloneNode(true));
+       }
 
-  document.body.appendChild(sizer);
-  var size = new google.maps.Size(sizer.offsetWidth, sizer.offsetHeight);
+       document.body.appendChild(sizer);
+       var size = new google.maps.Size(sizer.offsetWidth, sizer.offsetHeight);
 
-  // If the width is bigger than the max width then set the width and size again
-  if (opt_maxWidth && size.width > opt_maxWidth) {
-    sizer.style['width'] = this.px(opt_maxWidth);
-    size = new google.maps.Size(sizer.offsetWidth, sizer.offsetHeight);
-  }
+       // If the width is bigger than the max width then set the width and size again
+       if (opt_maxWidth && size.width > opt_maxWidth) {
+               sizer.style['width'] = this.px(opt_maxWidth);
+               size = new google.maps.Size(sizer.offsetWidth, sizer.offsetHeight);
+       }
 
-  // If the height is bigger than the max height then set the height and size
-  // again
-  if (opt_maxHeight && size.height > opt_maxHeight) {
-    sizer.style['height'] = this.px(opt_maxHeight);
-    size = new google.maps.Size(sizer.offsetWidth, sizer.offsetHeight);
-  }
+       // If the height is bigger than the max height then set the height and size
+       // again
+       if (opt_maxHeight && size.height > opt_maxHeight) {
+               sizer.style['height'] = this.px(opt_maxHeight);
+               size = new google.maps.Size(sizer.offsetWidth, sizer.offsetHeight);
+       }
 
-  document.body.removeChild(sizer);
-  delete sizer;
-  return size;
+       document.body.removeChild(sizer);
+       return size;
 };
 
 
@@ -1628,10 +1610,10 @@ InfoBubble.prototype.getElementSize_ = function(element, opt_maxWidth,
  * Redraw the InfoBubble
  * @private
  */
-InfoBubble.prototype.redraw_ = function() {
-  this.figureOutSize_();
-  this.positionCloseButton_();
-  this.draw();
+InfoBubble.prototype.redraw_ = function () {
+       this.figureOutSize_();
+       this.positionCloseButton_();
+       this.draw();
 };
 
 
@@ -1639,114 +1621,113 @@ InfoBubble.prototype.redraw_ = function() {
  * Figure out the optimum size of the InfoBubble
  * @private
  */
-InfoBubble.prototype.figureOutSize_ = function() {
-  var map = this.get('map');
-
-  if (!map) {
-    return;
-  }
-
-  var padding = this.getPadding_();
-  var borderWidth = this.getBorderWidth_();
-  var borderRadius = this.getBorderRadius_();
-  var arrowSize = this.getArrowSize_();
-
-  var mapDiv = map.getDiv();
-  var gutter = arrowSize * 2;
-  var mapWidth = mapDiv.offsetWidth - gutter;
-  var mapHeight = mapDiv.offsetHeight - gutter - this.getAnchorHeight_();
-  var tabHeight = 0;
-  var width = /** @type {number} */ (this.get('minWidth') || 0);
-  var height = /** @type {number} */ (this.get('minHeight') || 0);
-  var maxWidth = /** @type {number} */ (this.get('maxWidth') || 0);
-  var maxHeight = /** @type {number} */ (this.get('maxHeight') || 0);
-
-  maxWidth = Math.min(mapWidth, maxWidth);
-  maxHeight = Math.min(mapHeight, maxHeight);
-
-  var tabWidth = 0;
-  if (this.tabs_.length) {
-    // If there are tabs then you need to check the size of each tab's content
-    for (var i = 0, tab; tab = this.tabs_[i]; i++) {
-      var tabSize = this.getElementSize_(tab.tab, maxWidth, maxHeight);
-      var contentSize = this.getElementSize_(tab.content, maxWidth, maxHeight);
-
-      if (width < tabSize.width) {
-        width = tabSize.width;
-      }
-
-      // Add up all the tab widths because they might end up being wider than
-      // the content
-      tabWidth += tabSize.width;
-
-      if (height < tabSize.height) {
-        height = tabSize.height;
-      }
-
-      if (tabSize.height > tabHeight) {
-        tabHeight = tabSize.height;
-      }
-
-      if (width < contentSize.width) {
-        width = contentSize.width;
-      }
-
-      if (height < contentSize.height) {
-        height = contentSize.height;
-      }
-    }
-  } else {
-    var content = /** @type {string|Node} */ (this.get('content'));
-    if (typeof content == 'string') {
-      content = this.htmlToDocumentFragment_(content);
-    }
-    if (content) {
-      var contentSize = this.getElementSize_(content, maxWidth, maxHeight);
-
-      if (width < contentSize.width) {
-        width = contentSize.width;
-      }
-
-      if (height < contentSize.height) {
-        height = contentSize.height;
-      }
-    }
-  }
-
-  if (maxWidth) {
-    width = Math.min(width, maxWidth);
-  }
-
-  if (maxHeight) {
-    height = Math.min(height, maxHeight);
-  }
-
-  width = Math.max(width, tabWidth);
-
-  if (width == tabWidth) {
-    width = width + 2 * padding;
-  }
-
-  arrowSize = arrowSize * 2;
-  width = Math.max(width, arrowSize);
-
-  // Maybe add this as a option so they can go bigger than the map if the user
-  // wants
-  if (width > mapWidth) {
-    width = mapWidth;
-  }
-
-  if (height > mapHeight) {
-    height = mapHeight - tabHeight;
-  }
-
-  if (this.tabsContainer_) {
-    this.tabHeight_ = tabHeight;
-    this.tabsContainer_.style['width'] = this.px(tabWidth);
-  }
-
-  this.contentContainer_.style['width'] = this.px(width);
-  this.contentContainer_.style['height'] = this.px(height);
+InfoBubble.prototype.figureOutSize_ = function () {
+       var map = /** @type {google.map.Map} */ this.get('map');
+
+       if (!map) {
+               return;
+       }
+
+       var padding = this.getPadding_();
+       var arrowSize = this.getArrowSize_();
+
+       var mapDiv = map.getDiv();
+       var gutter = arrowSize * 2;
+       var mapWidth = mapDiv.offsetWidth - gutter;
+       var mapHeight = mapDiv.offsetHeight - gutter - this.getAnchorHeight_();
+       var tabHeight = 0;
+       var width = /** @type {number} */ (this.get('minWidth') || 0);
+       var height = /** @type {number} */ (this.get('minHeight') || 0);
+       var maxWidth = /** @type {number} */ (this.get('maxWidth') || 0);
+       var maxHeight = /** @type {number} */ (this.get('maxHeight') || 0);
+       var contentSize;
+
+       maxWidth = Math.min(mapWidth, maxWidth);
+       maxHeight = Math.min(mapHeight, maxHeight);
+
+       var tabWidth = 0;
+       if (this.tabs_.length) {
+               // If there are tabs then you need to check the size of each tab's content
+               for (var i = 0, tab; tab = this.tabs_[i]; i++) {
+                       var tabSize = this.getElementSize_(tab.tab, maxWidth, maxHeight);
+                       contentSize = this.getElementSize_(tab.content, maxWidth, maxHeight);
+
+                       if (width < tabSize.width) {
+                               width = tabSize.width;
+                       }
+
+                       // Add up all the tab widths because they might end up being wider than
+                       // the content
+                       tabWidth += tabSize.width;
+
+                       if (height < tabSize.height) {
+                               height = tabSize.height;
+                       }
+
+                       if (tabSize.height > tabHeight) {
+                               tabHeight = tabSize.height;
+                       }
+
+                       if (width < contentSize.width) {
+                               width = contentSize.width;
+                       }
+
+                       if (height < contentSize.height) {
+                               height = contentSize.height;
+                       }
+               }
+       } else {
+               var content = /** @type {string} */ (this.get('content'));
+               if (typeof content == 'string') {
+                       content = this.htmlToDocumentFragment_(content);
+               }
+               if (content) {
+                       contentSize = this.getElementSize_(content, maxWidth, maxHeight);
+
+                       if (width < contentSize.width) {
+                               width = contentSize.width;
+                       }
+
+                       if (height < contentSize.height) {
+                               height = contentSize.height;
+                       }
+               }
+       }
+
+       if (maxWidth) {
+               width = Math.min(width, maxWidth);
+       }
+
+       if (maxHeight) {
+               height = Math.min(height, maxHeight);
+       }
+
+       width = Math.max(width, tabWidth);
+
+       if (width == tabWidth) {
+               width = width + 2 * padding;
+       }
+
+       arrowSize = arrowSize * 2;
+       width = Math.max(width, arrowSize);
+
+       // Maybe add this as a option so they can go bigger than the map if the user
+       // wants
+       if (width > mapWidth) {
+               width = mapWidth;
+       }
+
+       if (height > mapHeight) {
+               height = mapHeight - tabHeight;
+       }
+
+       if (this.tabsContainer_) {
+               this.tabHeight_ = tabHeight;
+               this.tabsContainer_.style['width'] = this.px(tabWidth);
+       }
+
+       this.contentContainer_.style['width'] = this.px(width);
+       this.contentContainer_.style['height'] = this.px(height);
 };
 
 
@@ -1758,20 +1739,20 @@ InfoBubble.prototype.figureOutSize_ = function() {
  *  @private
  *  @return {number} The height of the anchor.
  */
-InfoBubble.prototype.getAnchorHeight_ = function() {
-  var anchor = this.get('anchor');
-  if (anchor) {
-    var anchorPoint = /** @type google.maps.Point */(this.get('anchorPoint'));
+InfoBubble.prototype.getAnchorHeight_ = function () {
+       var anchor = this.get('anchor');
+       if (anchor) {
+               var anchorPoint = /** @type google.maps.Point */(this.get('anchorPoint'));
 
-    if (anchorPoint) {
-      return -1 * anchorPoint.y;
-    }
-  }
-  return 0;
+               if (anchorPoint) {
+                       return -1 * anchorPoint.y;
+               }
+       }
+       return 0;
 };
 
-InfoBubble.prototype.anchorPoint_changed = function() {
-  this.draw();
+InfoBubble.prototype.anchorPoint_changed = function () {
+       this.draw();
 };
 InfoBubble.prototype['anchorPoint_changed'] = InfoBubble.prototype.anchorPoint_changed;
 
@@ -1780,27 +1761,26 @@ InfoBubble.prototype['anchorPoint_changed'] = InfoBubble.prototype.anchorPoint_c
  * Position the close button in the right spot.
  * @private
  */
-InfoBubble.prototype.positionCloseButton_ = function() {
-  var br = this.getBorderRadius_();
-  var bw = this.getBorderWidth_();
+InfoBubble.prototype.positionCloseButton_ = function () {
+       var bw = this.getBorderWidth_();
 
-  var right = 6;
-  var top = 6;
+       var right = 6;
+       var top = 6;
 
-  if (this.tabs_.length && this.tabHeight_) {
-    top += this.tabHeight_;
-  }
+       if (this.tabs_.length && this.tabHeight_) {
+               top += this.tabHeight_;
+       }
 
-  top += bw;
-  right += bw;
+       top += bw;
+       right += bw;
 
-  var c = this.contentContainer_;
-  if (c && c.clientHeight < c.scrollHeight) {
-    // If there are scrollbars then move the cross in so it is not over
-    // scrollbar
-    right += 15;
-  }
+       var c = this.contentContainer_;
+       if (c && c.clientHeight < c.scrollHeight) {
+               // If there are scrollbars then move the cross in so it is not over
+               // scrollbar
+               right += 15;
+       }
 
-  this.close_.style['right'] = this.px(right);
-  this.close_.style['top'] = this.px(top);
+       this.close_.style['right'] = this.px(right);
+       this.close_.style['top'] = this.px(top);
 };
\ No newline at end of file
index da41706..ce1b6b6 100644 (file)
@@ -1,5 +1,4 @@
 /*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
-//@ sourceMappingURL=jquery-1.10.2.min.map
 */
 (function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
 }({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
index cbca44f..a5c1c88 100644 (file)
@@ -2,7 +2,7 @@ var map,
        mapConfiguration = mapConfiguration || {
                active: false,
                apiV3Layers: '',
-               language: '',
+               language: 'en',
                allowSensore: false
        },
        locations = locations || [],
diff --git a/Tests/Unit/Cache/AddLocationToCacheTest.php b/Tests/Unit/Cache/AddLocationToCacheTest.php
new file mode 100644 (file)
index 0000000..f28386b
--- /dev/null
@@ -0,0 +1,214 @@
+<?php
+namespace Evoweb\StoreFinder\Tests\Unit\Cache;
+
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2014 Sebastian Fischer, <typo3@evoweb.de>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Coordinate cache test
+ */
+class AddLocationToCacheTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+       /**
+        * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        */
+       protected $objectManager;
+
+       /**
+        * @var \Evoweb\StoreFinder\Cache\CoordinatesCache|\PHPUnit_Framework_MockObject_MockObject
+        */
+       protected $coordinatesCache;
+
+       /**
+        * @var \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication|\PHPUnit_Framework_MockObject_MockObject
+        */
+       protected $frontendUser;
+
+
+       /**
+        * Setup for tests
+        *
+        * @throws \InvalidArgumentException
+        * @throws \PHPUnit_Framework_Exception
+        * @return void
+        */
+       public function setUp() {
+               $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+               $this->coordinatesCache = $this->objectManager->get('Evoweb\\StoreFinder\\Cache\\CoordinatesCache');
+       }
+
+
+       /**
+        * Test for something
+        *
+        * @test
+        * @throws \PHPUnit_Framework_Exception
+        * @throws \TYPO3\CMS\Core\Exception
+        * @return void
+        */
+       public function locationWithZipCityCountryOnlyGetStoredInCacheTable() {
+               $this->coordinatesCache->flushCache();
+
+               $data = array(
+                       'address' => '',
+                       'zipcode' => substr(mktime(), -5),
+                       'city' => uniqid('City'),
+                       'state' => '',
+                       'country' => uniqid('Country'),
+               );
+
+               $constraint = $this->getConstraintStub($data);
+               $coordinate = array(
+                       'latitude' => $constraint->getLatitude(),
+                       'longitude' => $constraint->getLongitude()
+               );
+
+               $fields = array('zipcode', 'city', 'country');
+               $this->coordinatesCache->addCoordinateForAddress($constraint, $fields);
+
+               $fields = array('zipcode', 'city', 'country');
+               $hash = $this->coordinatesCache->getHashForAddressWithFields($constraint, $fields);
+               $this->assertEquals($coordinate, $this->coordinatesCache->getValueFromCacheTable($hash));
+       }
+
+       /**
+        * Test for something
+        *
+        * @test
+        * @throws \PHPUnit_Framework_Exception
+        * @throws \TYPO3\CMS\Core\Exception
+        * @return void
+        */
+       public function locationWithAddressZipCityStateCountryGetStoredInCacheTableIfStreetAndStateIsEmpty() {
+               $this->coordinatesCache->flushCache();
+
+               $data = array(
+                       'address' => '',
+                       'zipcode' => substr(mktime(), -5),
+                       'city' => uniqid('City'),
+                       'state' => '',
+                       'country' => uniqid('Country'),
+               );
+
+               $constraint = $this->getConstraintStub($data);
+               $coordinate = array(
+                       'latitude' => $constraint->getLatitude(),
+                       'longitude' => $constraint->getLongitude()
+               );
+
+               $fields = array('address', 'zipcode', 'city', 'state', 'country');
+               $this->coordinatesCache->addCoordinateForAddress($constraint, $fields);
+
+               $fields = array('zipcode', 'city', 'country');
+               $hash = $this->coordinatesCache->getHashForAddressWithFields($constraint, $fields);
+               $this->assertEquals($coordinate, $this->coordinatesCache->getValueFromCacheTable($hash));
+       }
+
+
+       /**
+        * Test for something
+        *
+        * @test
+        * @throws \TYPO3\CMS\Core\Exception
+        * @return void
+        */
+       public function locationWithAddressZipCityCountryGetStoredInSessionCache() {
+               $this->coordinatesCache->flushCache();
+
+               $data = array(
+                       'address' => uniqid('Address'),
+                       'zipcode' => substr(mktime(), -5),
+                       'city' => uniqid('City'),
+                       'state' => '',
+                       'country' => uniqid('Country'),
+               );
+
+               $constraint = $this->getConstraintStub($data);
+               $coordinate = array(
+                       'latitude' => $constraint->getLatitude(),
+                       'longitude' => $constraint->getLongitude()
+               );
+
+               $fields = array('address', 'zipcode', 'city', 'state', 'country');
+               $this->coordinatesCache->addCoordinateForAddress($constraint, $fields);
+
+               $fields = array('address', 'zipcode', 'city', 'country');
+               $hash = $this->coordinatesCache->getHashForAddressWithFields($constraint, $fields);
+               $this->assertEquals($coordinate, $this->coordinatesCache->getValueFromSession($hash));
+       }
+
+       /**
+        * Test for something
+        *
+        * @test
+        * @throws \TYPO3\CMS\Core\Exception
+        * @return void
+        */
+       public function locationWithAddressZipCityStateCountryGetStoredInSessionCache() {
+               $this->coordinatesCache->flushCache();
+
+               $data = array(
+                       'address' => uniqid('Address'),
+                       'zipcode' => substr(mktime(), -5),
+                       'city' => uniqid('City'),
+                       'state' => '',
+                       'country' => uniqid('Country'),
+               );
+
+               $constraint = $this->getConstraintStub($data);
+               $coordinate = array(
+                       'latitude' => $constraint->getLatitude(),
+                       'longitude' => $constraint->getLongitude()
+               );
+
+               $fields = array('address', 'zipcode', 'city', 'state', 'country');
+               $this->coordinatesCache->addCoordinateForAddress($constraint, $fields);
+
+               $fields = array('address', 'zipcode', 'city', 'state', 'country');
+               $hash = $this->coordinatesCache->getHashForAddressWithFields($constraint, $fields);
+               $this->assertEquals($coordinate, $this->coordinatesCache->getValueFromSession($hash));
+       }
+
+
+       /**
+        * Get a constraint stub
+        *
+        * @param array $data
+        * @return \Evoweb\StoreFinder\Domain\Model\Constraint
+        */
+       public function getConstraintStub($data) {
+               /** @var \Evoweb\StoreFinder\Domain\Model\Constraint $constraint */
+               $constraint = $this->objectManager->get('Evoweb\\StoreFinder\\Domain\\Model\\Constraint');
+
+               foreach ($data as $field => $value) {
+                       $setter = 'set' . ucfirst($field);
+                       if (method_exists($constraint, $setter)) {
+                               $constraint->{$setter}($value);
+                       }
+               }
+
+               $constraint->setLatitude(51.165691);
+               $constraint->setLongitude(10.451526);
+
+               return $constraint;
+       }
+}
\ No newline at end of file
index bee1094..cfa938f 100644 (file)
@@ -2,12 +2,26 @@
        "name": "evoweb/store-finder",
        "type": "typo3-cms-plugin",
        "description": "Store Finder",
-       "homepage": "http://typo3.org",
+       "homepage": "http://www.evoweb.de/",
+       "keywords": [ "store finder", "store locator", "poi", "shop list", "google map" ],
        "license": ["GPL-2.0+"],
-       "version": "0.0.1",
+       "authors": [
+               {
+                       "name": "Sebastian Fischer",
+                       "email": "typo3@evoweb.de",
+                       "homepage": "http://www.evoweb.de/"
+               }
+       ],
+
+       "version": "1.0.1",
 
        "require": {
                "php" : ">=5.3.7",
                "typo3/cms-core": ">=6.0.0"
+       },
+
+       "support": {
+               "issues": "http://forge.typo3.org/projects/extension-store_finder/issues",
+               "source": "https://git.typo3.org/TYPO3CMS/Extensions/store_finder.git"
        }
 }
\ No newline at end of file
index 3a2b21b..5081ca6 100644 (file)
@@ -15,7 +15,7 @@ $EM_CONF[$_EXTKEY] = array(
        'description' => 'Manage store locations, search by distance and show Google maps and route maps. stores can be tt_address, fe users and tt_news records too.',
        'category' => 'plugin',
        'shy' => 0,
-       'version' => '0.0.1',
+       'version' => '1.0.1',
        'dependencies' => '',
        'conflicts' => '',
        'priority' => '',
index 00c8805..1b00bac 100644 (file)
Binary files a/ext_icon.gif and b/ext_icon.gif differ
index 50c58fe..d4b9bee 100644 (file)
@@ -4,6 +4,12 @@ if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
 
+if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['store_finder_coordinate'])) {
+       $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['store_finder_coordinate'] = array(
+               'groups' => array('system')
+       );
+}
+
 /**
  * Default PageTS
  */
index 39b0957..1a8a91b 100644 (file)
@@ -120,4 +120,4 @@ CREATE TABLE tx_storefinder_location_location_mm (
 CREATE TABLE sys_category (
        children int(11) unsigned DEFAULT '0' NOT NULL,
        import_id int(11) DEFAULT '0' NOT NULL
-);
+);
\ No newline at end of file