<commit_before><?php

namespace Bolt\Extension\sahassar\gmaps;

class Extension extends \Bolt\BaseExtension
{

    public function getName()
    {
        return 'gmaps';
    }

    /**
     *
     */
    function initialize()
    {
        if ($this->app['config']->getWhichEnd()=='frontend') {
            if (isset($this->config['mapstyles'])) {
                $mapstyles = $this->config['mapstyles'];
            } else {
                $mapstyles = "''";
            }
            if (isset($this->config['defaultzoom'])) {
                $defaultzoom = $this->config['defaultzoom'];
            } else {
                $defaultzoom = 14;
            }
            
            $snippet = '<script>var mapstyles = '.$mapstyles.', defaultzoom = '.$defaultzoom.';</script>';
            if (!$this->app['config']->get('general/disable_script_injecting')){
                $this->addJavascript('/assets/gmaps.js');
            }
            
            $this->addTwigFunction('gmaps', 'gmapsExt');
            $this->addSnippet('endofbody', $snippet);
            }
        }
        function gmapsExt($latitude = "55.60806", $longitude = "13.014572", $html = "Hello from Sweden!", $icon = "map-marker", $color = "rgba(0,0,0,1)")<commit_msg>adding defualt height and font awesome<commit_after><?php

namespace Bolt\Extension\sahassar\gmaps;

class Extension extends \Bolt\BaseExtension
{

    public function getName()
    {
        return 'gmaps';
    }

    /**
     *
     */
    function initialize()
    {
        if ($this->app['config']->getWhichEnd()=='frontend') {
            if (isset($this->config['mapstyles'])) {
                $mapstyles = $this->config['mapstyles'];
            } else {
                $mapstyles = "''";
            }
            if (isset($this->config['defaultzoom'])) {
                $defaultzoom = $this->config['defaultzoom'];
            } else {
                $defaultzoom = 14;
            }
            
            $snippet = '<script>var mapstyles = '.$mapstyles.', defaultzoom = '.$defaultzoom.';</script><style>.map-canvas{height:50vh;}</style>';
            if (!$this->app['config']->get('general/disable_script_injecting')){
                $this->addJavascript('/assets/gmaps.js');
                $this->addCss('//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
            }
            
            $this->addTwigFunction('gmaps', 'gmapsExt');
            $this->addSnippet('endofbody', $snippet);
            }
        }
        function gmapsExt($latitude = "55.60806", $longitude = "13.014572", $html = "Hello from Sweden!", $icon = "map-marker", $color = "rgba(0,0,0,1)")
{'fraction_non_alphanumeric': 0.17598499061913697, 'fraction_numerical': 0.017636022514071294, 'mean_word_length': 1.9200438116100766, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3458087', 'n_tokens_mistral': 827, 'n_tokens_neox': 785, 'n_words': 115}